Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf intel-pt: Document IPC usage

Add brief documentation about instructions-per-cycle (IPC) information
derived from Intel PT.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190520113728.14389-13-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
5db47f43 3f055167

+30
+30
tools/perf/Documentation/intel-pt.txt
··· 103 103 system, asynchronous, interrupt, transaction abort, trace begin, trace end, and 104 104 in transaction, respectively. 105 105 106 + Another interesting field that is not printed by default is 'ipc' which can be 107 + displayed as follows: 108 + 109 + perf script --itrace=be -F+ipc 110 + 111 + There are two ways that instructions-per-cycle (IPC) can be calculated depending 112 + on the recording. 113 + 114 + If the 'cyc' config term (see config terms section below) was used, then IPC is 115 + calculated using the cycle count from CYC packets, otherwise MTC packets are 116 + used - refer to the 'mtc' config term. When MTC is used, however, the values 117 + are less accurate because the timing is less accurate. 118 + 119 + Because Intel PT does not update the cycle count on every branch or instruction, 120 + the values will often be zero. When there are values, they will be the number 121 + of instructions and number of cycles since the last update, and thus represent 122 + the average IPC since the last IPC for that event type. Note IPC for "branches" 123 + events is calculated separately from IPC for "instructions" events. 124 + 125 + Also note that the IPC instruction count may or may not include the current 126 + instruction. If the cycle count is associated with an asynchronous branch 127 + (e.g. page fault or interrupt), then the instruction count does not include the 128 + current instruction, otherwise it does. That is consistent with whether or not 129 + that instruction has retired when the cycle count is updated. 130 + 131 + Another note, in the case of "branches" events, non-taken branches are not 132 + presently sampled, so IPC values for them do not appear e.g. a CYC packet with a 133 + TNT packet that starts with a non-taken branch. To see every possible IPC 134 + value, "instructions" events can be used e.g. --itrace=i0ns 135 + 106 136 While it is possible to create scripts to analyze the data, an alternative 107 137 approach is available to export the data to a sqlite or postgresql database. 108 138 Refer to script export-to-sqlite.py or export-to-postgresql.py for more details,