提交 935aac2d 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

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: NAdrian Hunter <adrian.hunter@intel.com>
Reviewed-by: NAndi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200710151104.15137-8-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 1d846aeb
...@@ -53,3 +53,8 @@ ...@@ -53,3 +53,8 @@
The flags are: The flags are:
o overflow o overflow
l trace data lost l trace data lost
If supported, the 'd' option may be followed by flags which affect what
debug messages will or will not be logged. Each flag must be preceded
by either '+' or '-'. The flags are:
a all perf events
...@@ -1483,6 +1483,9 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str, ...@@ -1483,6 +1483,9 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
break; break;
case 'd': case 'd':
synth_opts->log = true; synth_opts->log = true;
if (get_flags(&p, &synth_opts->log_plus_flags,
&synth_opts->log_minus_flags))
goto out_err;
break; break;
case 'c': case 'c':
synth_opts->branches = true; synth_opts->branches = true;
......
...@@ -58,6 +58,8 @@ enum itrace_period_type { ...@@ -58,6 +58,8 @@ enum itrace_period_type {
#define AUXTRACE_ERR_FLG_OVERFLOW (1 << ('o' - 'a')) #define AUXTRACE_ERR_FLG_OVERFLOW (1 << ('o' - 'a'))
#define AUXTRACE_ERR_FLG_DATA_LOST (1 << ('l' - 'a')) #define AUXTRACE_ERR_FLG_DATA_LOST (1 << ('l' - 'a'))
#define AUXTRACE_LOG_FLG_ALL_PERF_EVTS (1 << ('a' - 'a'))
/** /**
* struct itrace_synth_opts - AUX area tracing synthesis options. * struct itrace_synth_opts - AUX area tracing synthesis options.
* @set: indicates whether or not options have been set * @set: indicates whether or not options have been set
...@@ -96,6 +98,8 @@ enum itrace_period_type { ...@@ -96,6 +98,8 @@ enum itrace_period_type {
* @range_num: number of time intervals to trace * @range_num: number of time intervals to trace
* @error_plus_flags: flags to affect what errors are reported * @error_plus_flags: flags to affect what errors are reported
* @error_minus_flags: flags to affect what errors are reported * @error_minus_flags: flags to affect what errors are reported
* @log_plus_flags: flags to affect what is logged
* @log_minus_flags: flags to affect what is logged
*/ */
struct itrace_synth_opts { struct itrace_synth_opts {
bool set; bool set;
...@@ -131,6 +135,8 @@ struct itrace_synth_opts { ...@@ -131,6 +135,8 @@ struct itrace_synth_opts {
int range_num; int range_num;
unsigned int error_plus_flags; unsigned int error_plus_flags;
unsigned int error_minus_flags; unsigned int error_minus_flags;
unsigned int log_plus_flags;
unsigned int log_minus_flags;
}; };
/** /**
...@@ -624,7 +630,9 @@ bool auxtrace__evsel_is_auxtrace(struct perf_session *session, ...@@ -624,7 +630,9 @@ bool auxtrace__evsel_is_auxtrace(struct perf_session *session,
" each flag must be preceded by + or -\n" \ " each flag must be preceded by + or -\n" \
" error flags are: o (overflow)\n" \ " error flags are: o (overflow)\n" \
" l (data lost)\n" \ " l (data lost)\n" \
" d: create a debug log\n" \ " d[flags]: create a debug log\n" \
" each flag must be preceded by + or -\n" \
" log flags are: a (all perf events)\n" \
" f: synthesize first level cache events\n" \ " f: synthesize first level cache events\n" \
" m: synthesize last level cache events\n" \ " m: synthesize last level cache events\n" \
" t: synthesize TLB events\n" \ " t: synthesize TLB events\n" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册