Skip to content

Commit 9f74d77

Browse files
t00214307acmel
authored andcommitted
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 <[email protected]> Tested-by: James Clark <[email protected]> Acked-by: Adrian Hunter <[email protected]> Cc: Al Grant <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jin Yao <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: James Clark <[email protected]> Signed-off-by: Leo Yan <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 4db25f6 commit 9f74d77

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

tools/perf/Documentation/itrace.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
i synthesize instructions events
2-
b synthesize branches events
2+
b synthesize branches events (branch misses for Arm SPE)
33
c synthesize branches events (calls only)
44
r synthesize branches events (returns only)
55
x synthesize transactions events
@@ -9,6 +9,10 @@
99
of aux-output (refer to perf record)
1010
e synthesize error events
1111
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
1216
g synthesize a call chain (use with i or x)
1317
G synthesize a call chain on existing event records
1418
l synthesize last branch entries (use with i or x)

tools/perf/util/auxtrace.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,11 @@ void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts,
13311331
synth_opts->pwr_events = true;
13321332
synth_opts->other_events = true;
13331333
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+
13341339
if (no_sample) {
13351340
synth_opts->period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS;
13361341
synth_opts->period = 1;
@@ -1491,6 +1496,18 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
14911496
goto out_err;
14921497
p = endptr;
14931498
break;
1499+
case 'f':
1500+
synth_opts->flc = true;
1501+
break;
1502+
case 'm':
1503+
synth_opts->llc = true;
1504+
break;
1505+
case 't':
1506+
synth_opts->tlb = true;
1507+
break;
1508+
case 'a':
1509+
synth_opts->remote_access = true;
1510+
break;
14941511
case ' ':
14951512
case ',':
14961513
break;

tools/perf/util/auxtrace.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ enum itrace_period_type {
6363
* because 'perf inject' will write it out
6464
* @instructions: whether to synthesize 'instructions' events
6565
* @branches: whether to synthesize 'branches' events
66+
* (branch misses only for Arm SPE)
6667
* @transactions: whether to synthesize events for transactions
6768
* @ptwrites: whether to synthesize events for ptwrites
6869
* @pwr_events: whether to synthesize power events
@@ -78,6 +79,10 @@ enum itrace_period_type {
7879
* @thread_stack: feed branches to the thread_stack
7980
* @last_branch: add branch context to 'instruction' events
8081
* @add_last_branch: add branch context to existing event records
82+
* @flc: whether to synthesize first level cache events
83+
* @llc: whether to synthesize last level cache events
84+
* @tlb: whether to synthesize TLB events
85+
* @remote_access: whether to synthesize remote access events
8186
* @callchain_sz: maximum callchain size
8287
* @last_branch_sz: branch context size
8388
* @period: 'instructions' events period
@@ -107,6 +112,10 @@ struct itrace_synth_opts {
107112
bool thread_stack;
108113
bool last_branch;
109114
bool add_last_branch;
115+
bool flc;
116+
bool llc;
117+
bool tlb;
118+
bool remote_access;
110119
unsigned int callchain_sz;
111120
unsigned int last_branch_sz;
112121
unsigned long long period;
@@ -596,14 +605,18 @@ bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
596605

597606
#define ITRACE_HELP \
598607
" i: synthesize instructions events\n" \
599-
" b: synthesize branches events\n" \
608+
" b: synthesize branches events (branch misses for Arm SPE)\n" \
600609
" c: synthesize branches events (calls only)\n" \
601610
" r: synthesize branches events (returns only)\n" \
602611
" x: synthesize transactions events\n" \
603612
" w: synthesize ptwrite events\n" \
604613
" p: synthesize power events\n" \
605614
" e: synthesize error events\n" \
606615
" d: create a debug log\n" \
616+
" f: synthesize first level cache events\n" \
617+
" m: synthesize last level cache events\n" \
618+
" t: synthesize TLB events\n" \
619+
" a: synthesize remote access events\n" \
607620
" g[len]: synthesize a call chain (use with i or x)\n" \
608621
" l[len]: synthesize last branch entries (use with i or x)\n" \
609622
" sNUMBER: skip initial number of events\n" \

0 commit comments

Comments
 (0)