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

perf auxtrace: Add four itrace options

This patch is to add four options to synthesize events which are
described as below:

'f': synthesize first level cache events
'm': synthesize last level cache events
't': synthesize TLB events
'a': synthesize remote access events

This four options will be used by ARM SPE as their first consumer.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Tested-by: James Clark <james.clark@arm.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Grant <al.grant@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lore.kernel.org/lkml/20200530122442.490-3-leo.yan@linaro.org
Signed-off-by: James Clark <james.clark@arm.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Tan Xiaojun and committed by
Arnaldo Carvalho de Melo
9f74d770 4db25f66

+36 -2
+5 -1
tools/perf/Documentation/itrace.txt
··· 1 1 i synthesize instructions events 2 - b synthesize branches events 2 + b synthesize branches events (branch misses for Arm SPE) 3 3 c synthesize branches events (calls only) 4 4 r synthesize branches events (returns only) 5 5 x synthesize transactions events ··· 9 9 of aux-output (refer to perf record) 10 10 e synthesize error events 11 11 d create a debug log 12 + f synthesize first level cache events 13 + m synthesize last level cache events 14 + t synthesize TLB events 15 + a synthesize remote access events 12 16 g synthesize a call chain (use with i or x) 13 17 G synthesize a call chain on existing event records 14 18 l synthesize last branch entries (use with i or x)
+17
tools/perf/util/auxtrace.c
··· 1331 1331 synth_opts->pwr_events = true; 1332 1332 synth_opts->other_events = true; 1333 1333 synth_opts->errors = true; 1334 + synth_opts->flc = true; 1335 + synth_opts->llc = true; 1336 + synth_opts->tlb = true; 1337 + synth_opts->remote_access = true; 1338 + 1334 1339 if (no_sample) { 1335 1340 synth_opts->period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS; 1336 1341 synth_opts->period = 1; ··· 1495 1490 if (p == endptr) 1496 1491 goto out_err; 1497 1492 p = endptr; 1493 + break; 1494 + case 'f': 1495 + synth_opts->flc = true; 1496 + break; 1497 + case 'm': 1498 + synth_opts->llc = true; 1499 + break; 1500 + case 't': 1501 + synth_opts->tlb = true; 1502 + break; 1503 + case 'a': 1504 + synth_opts->remote_access = true; 1498 1505 break; 1499 1506 case ' ': 1500 1507 case ',':
+14 -1
tools/perf/util/auxtrace.h
··· 63 63 * because 'perf inject' will write it out 64 64 * @instructions: whether to synthesize 'instructions' events 65 65 * @branches: whether to synthesize 'branches' events 66 + * (branch misses only for Arm SPE) 66 67 * @transactions: whether to synthesize events for transactions 67 68 * @ptwrites: whether to synthesize events for ptwrites 68 69 * @pwr_events: whether to synthesize power events ··· 79 78 * @thread_stack: feed branches to the thread_stack 80 79 * @last_branch: add branch context to 'instruction' events 81 80 * @add_last_branch: add branch context to existing event records 81 + * @flc: whether to synthesize first level cache events 82 + * @llc: whether to synthesize last level cache events 83 + * @tlb: whether to synthesize TLB events 84 + * @remote_access: whether to synthesize remote access events 82 85 * @callchain_sz: maximum callchain size 83 86 * @last_branch_sz: branch context size 84 87 * @period: 'instructions' events period ··· 112 107 bool thread_stack; 113 108 bool last_branch; 114 109 bool add_last_branch; 110 + bool flc; 111 + bool llc; 112 + bool tlb; 113 + bool remote_access; 115 114 unsigned int callchain_sz; 116 115 unsigned int last_branch_sz; 117 116 unsigned long long period; ··· 605 596 606 597 #define ITRACE_HELP \ 607 598 " i: synthesize instructions events\n" \ 608 - " b: synthesize branches events\n" \ 599 + " b: synthesize branches events (branch misses for Arm SPE)\n" \ 609 600 " c: synthesize branches events (calls only)\n" \ 610 601 " r: synthesize branches events (returns only)\n" \ 611 602 " x: synthesize transactions events\n" \ ··· 613 604 " p: synthesize power events\n" \ 614 605 " e: synthesize error events\n" \ 615 606 " d: create a debug log\n" \ 607 + " f: synthesize first level cache events\n" \ 608 + " m: synthesize last level cache events\n" \ 609 + " t: synthesize TLB events\n" \ 610 + " a: synthesize remote access events\n" \ 616 611 " g[len]: synthesize a call chain (use with i or x)\n" \ 617 612 " l[len]: synthesize last branch entries (use with i or x)\n" \ 618 613 " sNUMBER: skip initial number of events\n" \