Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp44256ybj; Fri, 8 May 2020 06:11:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKFYwxu/lV0X/9kmOzU3EPVss996R3pdiKm6Gg0A5KIQUF4iJ0i0QtOGDge3H1dI5V4Ec0z X-Received: by 2002:a17:906:31d7:: with SMTP id f23mr1801170ejf.118.1588943504317; Fri, 08 May 2020 06:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588943504; cv=none; d=google.com; s=arc-20160816; b=zu5BjKvafWJ1yxvjD0WN7AKkSkTWhvg1F8yWyiRHiYDI/nvWxVoZa6o1qXJLA+pOz7 sFK+G3z9xq2I46QMPlZk/e73+tvQJKgE9Cq9o7ZskQIQsLha8L2n5p5V1U7mHeZR5ndh 6xoyI14bwIj4l1DuJUmtdABrT2TBeBV3TYS8mynH9PTCfCM5OSeh1Bsb5GXHNJ67Ls0U 5Zk0M8j+vLOgfyqWFYtSCdYIK9QdmAvdlUKfk7oKsWyu8/VPbidqtX5WXqayhpbEbXyF mXWa4uApV70GNo7uHwj64RuQspDzL9efxfdagS59P8hy8zbfa3SUFSJnSAm1k/Ak8OTi P+Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=sQs5WK9cjC8GAcWCMBnBZt9loH+0wxmYh/rnAH7gMVw=; b=XupiZXvQagvahAi6GgHCLtDcOIvxH0sfBJgKmnA5EvaZkxGC+GDEbTT/Bsy6+u7KEZ wnwQSFG6WxRqbIr/EvoOwuJejGtPrL1zP5eDrXG5U7I2aVBCePgZMUpI7tlXd3eiPn7S D5gdGd7EuGEhYCPX+grqX9Dy2onhY2Ojk4k5n1zrxLzuBrL1k+6n/OeRTIGpzV8N6FbF 3Rjnya4+1BCGdP0ayZ3I0T+6G7OH73O4HR1ir1nUYlN9PTLDaX/OGH9Aew8e/j/Iqjn6 fpsgyE3kB00Y8DB0uS6iyskCqv0rYE/+U8sYZdtscabdomYnZsbXH5Spqw5Qk9Z4T6rB lX7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si894971edr.209.2020.05.08.06.11.20; Fri, 08 May 2020 06:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730541AbgEHNJv (ORCPT + 99 others); Fri, 8 May 2020 09:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730484AbgEHNFU (ORCPT ); Fri, 8 May 2020 09:05:20 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE47DC05BD09; Fri, 8 May 2020 06:05:19 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jX2gj-0007XG-AD; Fri, 08 May 2020 15:05:13 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 14A1A1C04CD; Fri, 8 May 2020 15:04:57 +0200 (CEST) Date: Fri, 08 May 2020 13:04:56 -0000 From: "tip-bot2 for Adrian Hunter" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf intel-pt: Update documentation about itrace G and L options Cc: Adrian Hunter , Andi Kleen , Jiri Olsa , Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: <20200429150751.12570-9-adrian.hunter@intel.com> References: <20200429150751.12570-9-adrian.hunter@intel.com> MIME-Version: 1.0 Message-ID: <158894309698.8414.1804138023783833053.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 43358d9dfb250842383cddad816a7538548a5070 Gitweb: https://git.kernel.org/tip/43358d9dfb250842383cddad816a7538548a5070 Author: Adrian Hunter AuthorDate: Wed, 29 Apr 2020 18:07:50 +03:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Tue, 05 May 2020 16:35:30 -03:00 perf intel-pt: Update documentation about itrace G and L options Provide a little more information about the new G and L options, particularly the issue with large PEBs. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200429150751.12570-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/itrace.txt | 4 ++- tools/perf/Documentation/perf-intel-pt.txt | 35 +++++++++++++++++++++- 2 files changed, 39 insertions(+) diff --git a/tools/perf/Documentation/itrace.txt b/tools/perf/Documentation/itrace.txt index 0326050..2714847 100644 --- a/tools/perf/Documentation/itrace.txt +++ b/tools/perf/Documentation/itrace.txt @@ -33,6 +33,10 @@ Also the number of last branch entries (default 64, max. 1024) for instructions or transactions events can be specified. + Similar to options g and l, size may also be specified for options G and L. + On x86, note that G and L work poorly when data has been recorded with + large PEBS. Refer linkperf:perf-intel-pt[1] man page for details. + It is also possible to skip events generated (instructions, branches, transactions, ptwrite, power) at the beginning. This is useful to ignore initialization code. diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index 456fdcb..782eb8a 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -821,7 +821,9 @@ The letters are: e synthesize tracing error events d create a debug log g synthesize a call chain (use with i or x) + G synthesize a call chain on existing event records l synthesize last branch entries (use with i or x) + L synthesize last branch entries on existing event records s skip initial number of events "Instructions" events look like they were recorded by "perf record -e @@ -912,6 +914,39 @@ transactions events can be specified. e.g. Note that last branch entries are cleared for each sample, so there is no overlap from one sample to the next. +The G and L options are designed in particular for sample mode, and work much +like g and l but add call chain and branch stack to the other selected events +instead of synthesized events. For example, to record branch-misses events for +'ls' and then add a call chain derived from the Intel PT trace: + + perf record --aux-sample -e '{intel_pt//u,branch-misses:u}' -- ls + perf report --itrace=Ge + +Although in fact G is a default for perf report, so that is the same as just: + + perf report + +One caveat with the G and L options is that they work poorly with "Large PEBS". +Large PEBS means PEBS records will be accumulated by hardware and the written +into the event buffer in one go. That reduces interrupts, but can give very +late timestamps. Because the Intel PT trace is synchronized by timestamps, +the PEBS events do not match the trace. Currently, Large PEBS is used only in +certain circumstances: + - hardware supports it + - PEBS is used + - event period is specified, instead of frequency + - the sample type is limited to the following flags: + PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_ADDR | + PERF_SAMPLE_ID | PERF_SAMPLE_CPU | PERF_SAMPLE_STREAM_ID | + PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | + PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | + PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | + PERF_SAMPLE_PERIOD (and sometimes) | PERF_SAMPLE_TIME +Because Intel PT sample mode uses a different sample type to the list above, +Large PEBS is not used with Intel PT sample mode. To avoid Large PEBS in other +cases, avoid specifying the event period i.e. avoid the 'perf record' -c option, +--count option, or 'period' config term. + To disable trace decoding entirely, use the option --no-itrace. It is also possible to skip events generated (instructions, branches, transactions)