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

perf auxtrace: Factor out itrace_do_parse_synth_opts()

Factor out itrace_do_parse_synth_opts() so that it can be reused.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210530192308.7382-9-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
e621b8ff 13c71b92

+17 -3
+7 -3
tools/perf/util/auxtrace.c
··· 1405 1405 * about the options parsed here, which is introduced after this cset, 1406 1406 * when support in 'perf script' for these options is introduced. 1407 1407 */ 1408 - int itrace_parse_synth_opts(const struct option *opt, const char *str, 1409 - int unset) 1408 + int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts, 1409 + const char *str, int unset) 1410 1410 { 1411 - struct itrace_synth_opts *synth_opts = opt->value; 1412 1411 const char *p; 1413 1412 char *endptr; 1414 1413 bool period_type_set = false; ··· 1593 1594 out_err: 1594 1595 pr_err("Bad Instruction Tracing options '%s'\n", str); 1595 1596 return -EINVAL; 1597 + } 1598 + 1599 + int itrace_parse_synth_opts(const struct option *opt, const char *str, int unset) 1600 + { 1601 + return itrace_do_parse_synth_opts(opt->value, str, unset); 1596 1602 } 1597 1603 1598 1604 static const char * const auxtrace_error_type_name[] = {
+10
tools/perf/util/auxtrace.h
··· 607 607 union perf_event *event); 608 608 int perf_event__process_auxtrace_error(struct perf_session *session, 609 609 union perf_event *event); 610 + int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts, 611 + const char *str, int unset); 610 612 int itrace_parse_synth_opts(const struct option *opt, const char *str, 611 613 int unset); 612 614 void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts, ··· 738 736 void events_stats__auxtrace_error_warn(const struct events_stats *stats 739 737 __maybe_unused) 740 738 { 739 + } 740 + 741 + static inline 742 + int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts __maybe_unused, 743 + const char *str __maybe_unused, int unset __maybe_unused) 744 + { 745 + pr_err("AUX area tracing not supported\n"); 746 + return -EINVAL; 741 747 } 742 748 743 749 static inline