diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2017-06-21 12:17:19 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-27 17:03:09 +0200 |
commit | 1405720d4f2669e5ebaed192bd727aca74f64732 (patch) | |
tree | 4a456ee00f46ffc7847764c3945ca6a96a016d19 /tools/perf/util/event.h | |
parent | x86/insn: perf tools: Add new ptwrite instruction (diff) | |
download | linux-1405720d4f2669e5ebaed192bd727aca74f64732.tar.xz linux-1405720d4f2669e5ebaed192bd727aca74f64732.zip |
perf script: Add 'synth' event type for synthesized events
Instruction trace decoders such as Intel PT may have additional information
recorded in the trace. For example, Intel PT has power information and a
there is a new instruction 'ptwrite' that can write a value into a PTWRITE
trace packet.
Such information may be associated with an IP and so can be treated as a
sample (PERF_RECORD_SAMPLE). Custom data can be incorporated in the
sample as raw_data (PERF_SAMPLE_RAW).
However a means of identifying the raw data format is needed. That will
be done by synthesizing an attribute for it.
So add an attribute type for custom synthesized events. Different
synthesized events will be identified by the attribute 'config'.
Committer notes:
Start those PERF_TYPE_ after the PMU range, i.e. after (INT_MAX + 1U),
i.e. after perf_pmu_register() -> idr_alloc(end=0).
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1498040239-32418-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r-- | tools/perf/util/event.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 7c3fa1c8cbcd..855733c2adcf 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -252,6 +252,9 @@ enum auxtrace_error_type { PERF_AUXTRACE_ERROR_MAX }; +/* Attribute type for custom synthesized events */ +#define PERF_TYPE_SYNTH (INT_MAX + 1U) + /* * The kernel collects the number of events it couldn't send in a stretch and * when possible sends this number in a PERF_RECORD_LOST event. The number of |