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

Configure Feed

Select the types of activity you want to include in your feed.

perf report: Convert to the global annotation_options

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>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
14953f03 9d03194a

+16 -17
+16 -17
tools/perf/builtin-report.c
··· 98 98 bool skip_empty; 99 99 int max_stack; 100 100 struct perf_read_values show_threads_values; 101 - struct annotation_options annotation_opts; 102 101 const char *pretty_printing_style; 103 102 const char *cpu_list; 104 103 const char *symbol_filter_str; ··· 541 542 ret = report__browse_block_hists(&rep->block_reports[i++].hist, 542 543 rep->min_percent, pos, 543 544 &rep->session->header.env, 544 - &rep->annotation_opts); 545 + &annotate_opts); 545 546 if (ret != 0) 546 547 return ret; 547 548 } ··· 669 670 } 670 671 671 672 ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent, 672 - &session->header.env, true, &rep->annotation_opts); 673 + &session->header.env, true, &annotate_opts); 673 674 /* 674 675 * Usually "ret" is the last pressed key, and we only 675 676 * care if the key notifies us to switch data file. ··· 744 745 if (rep->symbol_ipc && sym && !sym->annotate2) { 745 746 struct evsel *evsel = hists_to_evsel(he->hists); 746 747 747 - symbol__annotate2(&he->ms, evsel, &rep->annotation_opts, NULL); 748 + symbol__annotate2(&he->ms, evsel, &annotate_opts, NULL); 748 749 } 749 750 750 751 return 0; ··· 1340 1341 "list of cpus to profile"), 1341 1342 OPT_BOOLEAN('I', "show-info", &report.show_full_info, 1342 1343 "Display extended information about perf.data file"), 1343 - OPT_BOOLEAN(0, "source", &report.annotation_opts.annotate_src, 1344 + OPT_BOOLEAN(0, "source", &annotate_opts.annotate_src, 1344 1345 "Interleave source code with assembly code (default)"), 1345 - OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw, 1346 + OPT_BOOLEAN(0, "asm-raw", &annotate_opts.show_asm_raw, 1346 1347 "Display raw encoding of assembly instructions (default)"), 1347 1348 OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", 1348 1349 "Specify disassembler style (e.g. -M intel for intel syntax)"), 1349 - OPT_STRING(0, "prefix", &report.annotation_opts.prefix, "prefix", 1350 + OPT_STRING(0, "prefix", &annotate_opts.prefix, "prefix", 1350 1351 "Add prefix to source file path names in programs (with --prefix-strip)"), 1351 - OPT_STRING(0, "prefix-strip", &report.annotation_opts.prefix_strip, "N", 1352 + OPT_STRING(0, "prefix-strip", &annotate_opts.prefix_strip, "N", 1352 1353 "Strip first N entries of source file path name in programs (with --prefix)"), 1353 1354 OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, 1354 1355 "Show a column with the sum of periods"), ··· 1400 1401 "Time span of interest (start,stop)"), 1401 1402 OPT_BOOLEAN(0, "inline", &symbol_conf.inline_name, 1402 1403 "Show inline function"), 1403 - OPT_CALLBACK(0, "percent-type", &report.annotation_opts, "local-period", 1404 + OPT_CALLBACK(0, "percent-type", &annotate_opts, "local-period", 1404 1405 "Set percent type local/global-period/hits", 1405 1406 annotate_parse_percent_type), 1406 1407 OPT_BOOLEAN(0, "ns", &symbol_conf.nanosecs, "Show times in nanosecs"), ··· 1432 1433 */ 1433 1434 symbol_conf.keep_exited_threads = true; 1434 1435 1435 - annotation_options__init(&report.annotation_opts); 1436 + annotation_options__init(&annotate_opts); 1436 1437 1437 1438 ret = perf_config(report__config, &report); 1438 1439 if (ret) ··· 1451 1452 } 1452 1453 1453 1454 if (disassembler_style) { 1454 - report.annotation_opts.disassembler_style = strdup(disassembler_style); 1455 - if (!report.annotation_opts.disassembler_style) 1455 + annotate_opts.disassembler_style = strdup(disassembler_style); 1456 + if (!annotate_opts.disassembler_style) 1456 1457 return -ENOMEM; 1457 1458 } 1458 1459 if (objdump_path) { 1459 - report.annotation_opts.objdump_path = strdup(objdump_path); 1460 - if (!report.annotation_opts.objdump_path) 1460 + annotate_opts.objdump_path = strdup(objdump_path); 1461 + if (!annotate_opts.objdump_path) 1461 1462 return -ENOMEM; 1462 1463 } 1463 1464 if (addr2line_path) { ··· 1466 1467 return -ENOMEM; 1467 1468 } 1468 1469 1469 - if (annotate_check_args(&report.annotation_opts) < 0) { 1470 + if (annotate_check_args(&annotate_opts) < 0) { 1470 1471 ret = -EINVAL; 1471 1472 goto exit; 1472 1473 } ··· 1698 1699 */ 1699 1700 symbol_conf.priv_size += sizeof(u32); 1700 1701 } 1701 - annotation_config__init(&report.annotation_opts); 1702 + annotation_config__init(&annotate_opts); 1702 1703 } 1703 1704 1704 1705 if (symbol__init(&session->header.env) < 0) ··· 1752 1753 zstd_fini(&(session->zstd_data)); 1753 1754 perf_session__delete(session); 1754 1755 exit: 1755 - annotation_options__exit(&report.annotation_opts); 1756 + annotation_options__exit(&annotate_opts); 1756 1757 free(sort_order_help); 1757 1758 free(field_order_help); 1758 1759 return ret;