mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 25/25] perf intel-pt: Add documentation for Event Trace and TNT disable
Date: Mon, 24 Jan 2022 10:42:01 +0200	[thread overview]
Message-ID: <20220124084201.2699795-26-adrian.hunter@intel.com> (raw)
In-Reply-To: <20220124084201.2699795-1-adrian.hunter@intel.com>

Add documentation for Event Trace and TNT disable to the perf Intel PT man
page.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/Documentation/perf-intel-pt.txt | 104 ++++++++++++++++++++-
 1 file changed, 102 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt
index cbb920f5d056..ff58bd4c381b 100644
--- a/tools/perf/Documentation/perf-intel-pt.txt
+++ b/tools/perf/Documentation/perf-intel-pt.txt
@@ -108,9 +108,10 @@ displayed as follows:
 
 	perf script --itrace=ibxwpe -F+flags
 
-The flags are "bcrosyiABExgh" which stand for branch, call, return, conditional,
+The flags are "bcrosyiABExghDt" which stand for branch, call, return, conditional,
 system, asynchronous, interrupt, transaction abort, trace begin, trace end,
-in transaction, VM-entry, and VM-exit respectively.
+in transaction, VM-entry, VM-exit, interrupt disabled, and interrupt disable
+toggle respectively.
 
 perf script also supports higher level ways to dump instruction traces:
 
@@ -483,6 +484,30 @@ pwr_evt		Enable power events.  The power events provide information about
 		which contains "1" if the feature is supported and
 		"0" otherwise.
 
+event		Enable Event Trace.  The events provide information about asynchronous
+		events.
+
+		Support for this feature is indicated by:
+
+			/sys/bus/event_source/devices/intel_pt/caps/event_trace
+
+		which contains "1" if the feature is supported and
+		"0" otherwise.
+
+notnt		Disable TNT packets.  Without TNT packets, it is not possible to walk
+		executable code to reconstruct control flow, however FUP, TIP, TIP.PGE
+		and TIP.PGD packets still indicate asynchronous control flow, and (if
+		return compression is disabled - see noretcomp) return statements.
+		The advantage of eliminating TNT packets is reducing the size of the
+		trace and corresponding tracing overhead.
+
+		Support for this feature is indicated by:
+
+			/sys/bus/event_source/devices/intel_pt/caps/tnt_disable
+
+		which contains "1" if the feature is supported and
+		"0" otherwise.
+
 
 AUX area sampling option
 ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -876,6 +901,8 @@ The letters are:
 	p	synthesize "power" events (incl. PSB events)
 	c	synthesize branches events (calls only)
 	r	synthesize branches events (returns only)
+	o	synthesize PEBS-via-PT events
+	I	synthesize Event Trace events
 	e	synthesize tracing error events
 	d	create a debug log
 	g	synthesize a call chain (use with i or x)
@@ -1371,6 +1398,79 @@ There were none.
           :17006 17006 [001] 11500.262869216:  ffffffff8220116e error_entry+0xe ([guest.kernel.kallsyms])               pushq  %rax
 
 
+Event Trace
+-----------
+
+Event Trace records information about asynchronous events, for example interrupts,
+faults, VM exits and entries.  The information is recorded in CFE and EVD packets,
+and also the Interrupt Flag is recorded on the MODE.Exec packet.  The CFE packet
+contains a type field to identify one of the following:
+
+	 1	INTR		interrupt, fault, exception, NMI
+	 2	IRET		interrupt return
+	 3	SMI		system management interrupt
+	 4	RSM		resume from system management mode
+	 5	SIPI		startup interprocessor interrupt
+	 6	INIT		INIT signal
+	 7	VMENTRY		VM-Entry
+	 8	VMEXIT		VM-Entry
+	 9	VMEXIT_INTR	VM-Exit due to interrupt
+	10	SHUTDOWN	Shutdown
+
+For more details, refer to the Intel 64 and IA-32 Architectures Software
+Developer Manuals (version 076 or later).
+
+The capability to do Event Trace is indicated by the
+/sys/bus/event_source/devices/intel_pt/caps/event_trace file.
+
+Event trace is selected for recording using the "event" config term. e.g.
+
+	perf record -e intel_pt/event/u uname
+
+Event trace events are output using the --itrace I option. e.g.
+
+	perf script --itrace=Ie
+
+perf script displays events containing CFE type, vector and event data,
+in the form:
+
+	  evt:   hw int            (t)  cfe: INTR IP: 1 vector: 3 PFA: 0x8877665544332211
+
+The IP flag indicates if the event binds to an IP, which includes any case where
+flow control packet generation is enabled, as well as when CFE packet IP bit is
+set.
+
+perf script displays events containing changes to the Interrupt Flag in the form:
+
+	iflag:   t                      IFLAG: 1->0 via branch
+
+where "via branch" indicates a branch (interrupt or return from interrupt) and
+"non branch" indicates an instruction such as CFI, STI or POPF).
+
+In addition, the current state of the interrupt flag is indicated by the presence
+or absence of the "D" (interrupt disabled) perf script flag.  If the interrupt
+flag is changed, then the "t" flag is also included i.e.
+
+		no flag, interrupts enabled IF=1
+	t	interrupts become disabled IF=1 -> IF=0
+	D	interrupts are disabled IF=0
+	Dt	interrupts become enabled  IF=0 -> IF=1
+
+The intel-pt-events.py script illustrates how to access Event Trace information
+using a Python script.
+
+
+TNT Disable
+-----------
+
+TNT packets are disabled using the "notnt" config term. e.g.
+
+	perf record -e intel_pt/notnt/u uname
+
+In that case the --itrace q option is forced because walking executable code
+to reconstruct the control flow is not possible.
+
+
 
 SEE ALSO
 --------
-- 
2.25.1


  parent reply	other threads:[~2022-01-24  8:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  8:41 [PATCH 00/25] perf intel-pt: Add support " Adrian Hunter
2022-01-24  8:41 ` [PATCH 01/25] perf intel-pt: pkt-decoder-test: Fix scope of test_data Adrian Hunter
2022-01-24  8:41 ` [PATCH 02/25] perf intel-pt: pkt-decoder: Remove misplaced linebreak Adrian Hunter
2022-01-24  8:41 ` [PATCH 03/25] perf intel-pt: pkt-decoder: Add CFE and EVD packets Adrian Hunter
2022-01-24  8:41 ` [PATCH 04/25] perf intel-pt: pkt-decoder: Add MODE.Exec IFLAG bit Adrian Hunter
2022-01-24  8:41 ` [PATCH 05/25] perf intel-pt: decoder: Add config bit definitions Adrian Hunter
2022-01-24  8:41 ` [PATCH 06/25] perf intel-pt: decoder: Factor out clearing of FUP event variables Adrian Hunter
2022-01-24  8:41 ` [PATCH 07/25] perf intel-pt: decoder: Add CFE and EVD processing Adrian Hunter
2022-01-24  8:41 ` [PATCH 08/25] perf intel-pt: decoder: Add MODE.Exec IFLAG processing Adrian Hunter
2022-01-24  8:41 ` [PATCH 09/25] perf tools: Define Intel PT CFE / EVD event Adrian Hunter
2022-01-24  8:41 ` [PATCH 10/25] perf tools: Define Intel PT iflag synthesized event Adrian Hunter
2022-01-24  8:41 ` [PATCH 11/25] perf tools: Define new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 12/25] perf auxtrace: Add itrace option "I" Adrian Hunter
2022-01-24  8:41 ` [PATCH 13/25] perf intel-pt: Record Event Trace capability flag Adrian Hunter
2022-01-24  8:41 ` [PATCH 14/25] perf intel-pt: Synthesize CFE / EVD event Adrian Hunter
2022-01-24  8:41 ` [PATCH 15/25] perf intel-pt: Synthesize iflag event Adrian Hunter
2022-01-24  8:41 ` [PATCH 16/25] perf intel-pt: Synthesize new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 17/25] perf intel-pt: Force 'quick' mode when TNT is disabled Adrian Hunter
2022-01-24  8:41 ` [PATCH 18/25] perf script: Display Intel PT CFE / EVD synthesized event Adrian Hunter
2022-01-24  8:41 ` [PATCH 19/25] perf script: Display Intel PT iflag " Adrian Hunter
2022-01-24  8:41 ` [PATCH 20/25] perf script: Display new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 21/25] perf scripts python: intel-pt-events.py: Add Event Trace Adrian Hunter
2022-01-24  8:41 ` [PATCH 22/25] perf scripting python: Add all sample flags to DB export Adrian Hunter
2022-01-24  8:41 ` [PATCH 23/25] perf scripts python: export-to-sqlite.py: Export all sample flags Adrian Hunter
2022-01-24  8:42 ` [PATCH 24/25] perf scripts python: export-to-postgresql.py: " Adrian Hunter
2022-01-24  8:42 ` Adrian Hunter [this message]
2022-02-15 14:27 ` [PATCH 00/25] perf intel-pt: Add support for Event Trace and TNT disable Arnaldo Carvalho de Melo
2022-02-15 19:39   ` Arnaldo Carvalho de Melo
2022-02-16  6:12     ` Adrian Hunter
2022-02-16  9:46       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220124084201.2699795-26-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome