mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 20:59:37 +02:00
perf report: Convert to the global annotation_options
[ Upstream commit14953f038d
] Use the global option and drop the local copy. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20231128175441.721579-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Stable-dep-of:aaf494cf48
("perf annotate: Fix annotation_calc_lines() to pass correct address to get_srcline()") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
dfd02119ae
commit
e0af85d60b
|
@ -98,7 +98,6 @@ struct report {
|
||||||
bool skip_empty;
|
bool skip_empty;
|
||||||
int max_stack;
|
int max_stack;
|
||||||
struct perf_read_values show_threads_values;
|
struct perf_read_values show_threads_values;
|
||||||
struct annotation_options annotation_opts;
|
|
||||||
const char *pretty_printing_style;
|
const char *pretty_printing_style;
|
||||||
const char *cpu_list;
|
const char *cpu_list;
|
||||||
const char *symbol_filter_str;
|
const char *symbol_filter_str;
|
||||||
|
@ -542,7 +541,7 @@ static int evlist__tui_block_hists_browse(struct evlist *evlist, struct report *
|
||||||
ret = report__browse_block_hists(&rep->block_reports[i++].hist,
|
ret = report__browse_block_hists(&rep->block_reports[i++].hist,
|
||||||
rep->min_percent, pos,
|
rep->min_percent, pos,
|
||||||
&rep->session->header.env,
|
&rep->session->header.env,
|
||||||
&rep->annotation_opts);
|
&annotate_opts);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -670,7 +669,7 @@ static int report__browse_hists(struct report *rep)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent,
|
ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent,
|
||||||
&session->header.env, true, &rep->annotation_opts);
|
&session->header.env, true, &annotate_opts);
|
||||||
/*
|
/*
|
||||||
* Usually "ret" is the last pressed key, and we only
|
* Usually "ret" is the last pressed key, and we only
|
||||||
* care if the key notifies us to switch data file.
|
* care if the key notifies us to switch data file.
|
||||||
|
@ -730,7 +729,7 @@ static int hists__resort_cb(struct hist_entry *he, void *arg)
|
||||||
if (rep->symbol_ipc && sym && !sym->annotate2) {
|
if (rep->symbol_ipc && sym && !sym->annotate2) {
|
||||||
struct evsel *evsel = hists_to_evsel(he->hists);
|
struct evsel *evsel = hists_to_evsel(he->hists);
|
||||||
|
|
||||||
symbol__annotate2(&he->ms, evsel, &rep->annotation_opts, NULL);
|
symbol__annotate2(&he->ms, evsel, &annotate_opts, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1326,15 +1325,15 @@ int cmd_report(int argc, const char **argv)
|
||||||
"list of cpus to profile"),
|
"list of cpus to profile"),
|
||||||
OPT_BOOLEAN('I', "show-info", &report.show_full_info,
|
OPT_BOOLEAN('I', "show-info", &report.show_full_info,
|
||||||
"Display extended information about perf.data file"),
|
"Display extended information about perf.data file"),
|
||||||
OPT_BOOLEAN(0, "source", &report.annotation_opts.annotate_src,
|
OPT_BOOLEAN(0, "source", &annotate_opts.annotate_src,
|
||||||
"Interleave source code with assembly code (default)"),
|
"Interleave source code with assembly code (default)"),
|
||||||
OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw,
|
OPT_BOOLEAN(0, "asm-raw", &annotate_opts.show_asm_raw,
|
||||||
"Display raw encoding of assembly instructions (default)"),
|
"Display raw encoding of assembly instructions (default)"),
|
||||||
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
|
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
|
||||||
"Specify disassembler style (e.g. -M intel for intel syntax)"),
|
"Specify disassembler style (e.g. -M intel for intel syntax)"),
|
||||||
OPT_STRING(0, "prefix", &report.annotation_opts.prefix, "prefix",
|
OPT_STRING(0, "prefix", &annotate_opts.prefix, "prefix",
|
||||||
"Add prefix to source file path names in programs (with --prefix-strip)"),
|
"Add prefix to source file path names in programs (with --prefix-strip)"),
|
||||||
OPT_STRING(0, "prefix-strip", &report.annotation_opts.prefix_strip, "N",
|
OPT_STRING(0, "prefix-strip", &annotate_opts.prefix_strip, "N",
|
||||||
"Strip first N entries of source file path name in programs (with --prefix)"),
|
"Strip first N entries of source file path name in programs (with --prefix)"),
|
||||||
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
|
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
|
||||||
"Show a column with the sum of periods"),
|
"Show a column with the sum of periods"),
|
||||||
|
@ -1386,7 +1385,7 @@ int cmd_report(int argc, const char **argv)
|
||||||
"Time span of interest (start,stop)"),
|
"Time span of interest (start,stop)"),
|
||||||
OPT_BOOLEAN(0, "inline", &symbol_conf.inline_name,
|
OPT_BOOLEAN(0, "inline", &symbol_conf.inline_name,
|
||||||
"Show inline function"),
|
"Show inline function"),
|
||||||
OPT_CALLBACK(0, "percent-type", &report.annotation_opts, "local-period",
|
OPT_CALLBACK(0, "percent-type", &annotate_opts, "local-period",
|
||||||
"Set percent type local/global-period/hits",
|
"Set percent type local/global-period/hits",
|
||||||
annotate_parse_percent_type),
|
annotate_parse_percent_type),
|
||||||
OPT_BOOLEAN(0, "ns", &symbol_conf.nanosecs, "Show times in nanosecs"),
|
OPT_BOOLEAN(0, "ns", &symbol_conf.nanosecs, "Show times in nanosecs"),
|
||||||
|
@ -1418,7 +1417,7 @@ int cmd_report(int argc, const char **argv)
|
||||||
*/
|
*/
|
||||||
symbol_conf.keep_exited_threads = true;
|
symbol_conf.keep_exited_threads = true;
|
||||||
|
|
||||||
annotation_options__init(&report.annotation_opts);
|
annotation_options__init(&annotate_opts);
|
||||||
|
|
||||||
ret = perf_config(report__config, &report);
|
ret = perf_config(report__config, &report);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1437,13 +1436,13 @@ int cmd_report(int argc, const char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disassembler_style) {
|
if (disassembler_style) {
|
||||||
report.annotation_opts.disassembler_style = strdup(disassembler_style);
|
annotate_opts.disassembler_style = strdup(disassembler_style);
|
||||||
if (!report.annotation_opts.disassembler_style)
|
if (!annotate_opts.disassembler_style)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
if (objdump_path) {
|
if (objdump_path) {
|
||||||
report.annotation_opts.objdump_path = strdup(objdump_path);
|
annotate_opts.objdump_path = strdup(objdump_path);
|
||||||
if (!report.annotation_opts.objdump_path)
|
if (!annotate_opts.objdump_path)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
if (addr2line_path) {
|
if (addr2line_path) {
|
||||||
|
@ -1452,7 +1451,7 @@ int cmd_report(int argc, const char **argv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (annotate_check_args(&report.annotation_opts) < 0) {
|
if (annotate_check_args(&annotate_opts) < 0) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -1684,7 +1683,7 @@ repeat:
|
||||||
*/
|
*/
|
||||||
symbol_conf.priv_size += sizeof(u32);
|
symbol_conf.priv_size += sizeof(u32);
|
||||||
}
|
}
|
||||||
annotation_config__init(&report.annotation_opts);
|
annotation_config__init(&annotate_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol__init(&session->header.env) < 0)
|
if (symbol__init(&session->header.env) < 0)
|
||||||
|
@ -1738,7 +1737,7 @@ error:
|
||||||
zstd_fini(&(session->zstd_data));
|
zstd_fini(&(session->zstd_data));
|
||||||
perf_session__delete(session);
|
perf_session__delete(session);
|
||||||
exit:
|
exit:
|
||||||
annotation_options__exit(&report.annotation_opts);
|
annotation_options__exit(&annotate_opts);
|
||||||
free(sort_order_help);
|
free(sort_order_help);
|
||||||
free(field_order_help);
|
free(field_order_help);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user