mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-11 00:45:13 +00:00
The current rXXXX event specification creates event under PERF_TYPE_RAW
pmu type. This change allows to use rXXXX within pmu syntax, so it's
type is used via the following syntax:
-e 'cpu/r3c/'
-e 'cpum_cf/r0/'
The XXXX number goes directly to perf_event_attr::config the same way as
in '-e rXXXX' event. The perf_event_attr::type is filled with pmu type.
Committer testing:
So, lets see what goes in perf_event_attr::config for, say, the
'instructions' PERF_TYPE_HARDWARE (0) event, first we should look at how
to encode this event as a PERF_TYPE_RAW event for this specific CPU, an
AMD Ryzen 5:
# cat /sys/devices/cpu/events/instructions
event=0xc0
#
Then try with it _and_ the instruction, just to see that they are close
enough:
# perf stat -e rc0,instructions sleep 1
Performance counter stats for 'sleep 1':
919,794 rc0
919,898 instructions
1.000754579 seconds time elapsed
0.000715000 seconds user
0.000000000 seconds sys
#
Now we should try, before this patch, the PMU event encoding:
# perf stat -e cpu/rc0/ sleep 1
event syntax error: 'cpu/rc0/'
\___ unknown term
valid terms: event,edge,inv,umask,cmask,config,config1,config2,name,period,percore
#
Now with this patch, the three ways of specifying the 'instructions' CPU
counter are accepted:
# perf stat -e cpu/rc0/,rc0,instructions sleep 1
Performance counter stats for 'sleep 1':
892,948 cpu/rc0/
893,052 rc0
893,156 instructions
1.000931819 seconds time elapsed
0.000916000 seconds user
0.000000000 seconds sys
#
Requested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20200416221405.437788-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
||
|---|---|---|
| .. | ||
| android.txt | ||
| asciidoc.conf | ||
| asciidoctor-extensions.rb | ||
| build-xed.txt | ||
| Build.txt | ||
| callchain-overhead-calculation.txt | ||
| db-export.txt | ||
| examples.txt | ||
| intel-bts.txt | ||
| intel-pt.txt | ||
| itrace.txt | ||
| jit-interface.txt | ||
| jitdump-specification.txt | ||
| Makefile | ||
| manpage-1.72.xsl | ||
| manpage-base.xsl | ||
| manpage-bold-literal.xsl | ||
| manpage-normal.xsl | ||
| manpage-suppress-sp.xsl | ||
| perf-annotate.txt | ||
| perf-archive.txt | ||
| perf-bench.txt | ||
| perf-buildid-cache.txt | ||
| perf-buildid-list.txt | ||
| perf-c2c.txt | ||
| perf-config.txt | ||
| perf-data.txt | ||
| perf-diff.txt | ||
| perf-evlist.txt | ||
| perf-ftrace.txt | ||
| perf-help.txt | ||
| perf-inject.txt | ||
| perf-intel-pt.txt | ||
| perf-kallsyms.txt | ||
| perf-kmem.txt | ||
| perf-kvm.txt | ||
| perf-list.txt | ||
| perf-lock.txt | ||
| perf-mem.txt | ||
| perf-probe.txt | ||
| perf-record.txt | ||
| perf-report.txt | ||
| perf-sched.txt | ||
| perf-script-perl.txt | ||
| perf-script-python.txt | ||
| perf-script.txt | ||
| perf-stat.txt | ||
| perf-test.txt | ||
| perf-timechart.txt | ||
| perf-top.txt | ||
| perf-trace.txt | ||
| perf-version.txt | ||
| perf.data-directory-format.txt | ||
| perf.data-file-format.txt | ||
| perf.txt | ||
| perfconfig.example | ||
| tips.txt | ||