Skip to content

Commit 935aac2

Browse files
ahunter6acmel
authored andcommitted
perf auxtrace: Add optional log flags to the itrace 'd' option
Allow the 'd' option to be followed by flags which will affect what debug messages will or will not be reported. Each flag must be preceded by either '+' or '-'. The flags are: a all perf events Signed-off-by: Adrian Hunter <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 1d846ae commit 935aac2

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

tools/perf/Documentation/itrace.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@
5353
The flags are:
5454
o overflow
5555
l trace data lost
56+
57+
If supported, the 'd' option may be followed by flags which affect what
58+
debug messages will or will not be logged. Each flag must be preceded
59+
by either '+' or '-'. The flags are:
60+
a all perf events

tools/perf/util/auxtrace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,9 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
14831483
break;
14841484
case 'd':
14851485
synth_opts->log = true;
1486+
if (get_flags(&p, &synth_opts->log_plus_flags,
1487+
&synth_opts->log_minus_flags))
1488+
goto out_err;
14861489
break;
14871490
case 'c':
14881491
synth_opts->branches = true;

tools/perf/util/auxtrace.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ enum itrace_period_type {
5858
#define AUXTRACE_ERR_FLG_OVERFLOW (1 << ('o' - 'a'))
5959
#define AUXTRACE_ERR_FLG_DATA_LOST (1 << ('l' - 'a'))
6060

61+
#define AUXTRACE_LOG_FLG_ALL_PERF_EVTS (1 << ('a' - 'a'))
62+
6163
/**
6264
* struct itrace_synth_opts - AUX area tracing synthesis options.
6365
* @set: indicates whether or not options have been set
@@ -96,6 +98,8 @@ enum itrace_period_type {
9698
* @range_num: number of time intervals to trace
9799
* @error_plus_flags: flags to affect what errors are reported
98100
* @error_minus_flags: flags to affect what errors are reported
101+
* @log_plus_flags: flags to affect what is logged
102+
* @log_minus_flags: flags to affect what is logged
99103
*/
100104
struct itrace_synth_opts {
101105
bool set;
@@ -131,6 +135,8 @@ struct itrace_synth_opts {
131135
int range_num;
132136
unsigned int error_plus_flags;
133137
unsigned int error_minus_flags;
138+
unsigned int log_plus_flags;
139+
unsigned int log_minus_flags;
134140
};
135141

136142
/**
@@ -624,7 +630,9 @@ bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
624630
" each flag must be preceded by + or -\n" \
625631
" error flags are: o (overflow)\n" \
626632
" l (data lost)\n" \
627-
" d: create a debug log\n" \
633+
" d[flags]: create a debug log\n" \
634+
" each flag must be preceded by + or -\n" \
635+
" log flags are: a (all perf events)\n" \
628636
" f: synthesize first level cache events\n" \
629637
" m: synthesize last level cache events\n" \
630638
" t: synthesize TLB events\n" \

0 commit comments

Comments
 (0)