diff options
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 11 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 1 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index a9338c071f568..ab776b1ed2d5b 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -406,6 +406,9 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser) browser->b.index = al->idx_asm; } + if (annotate_opts.hide_src_code_on_title) + annotate_opts.hide_src_code_on_title = false; + return true; } @@ -708,8 +711,12 @@ static int annotate__scnprintf_title(struct hists *hists, char *bf, size_t size) { int printed = hists__scnprintf_title(hists, bf, size); - return printed + scnprintf(bf + printed, size - printed, " [source: %s]", - annotate_opts.hide_src_code ? "OFF" : "On"); + if (!annotate_opts.hide_src_code_on_title) { + printed += scnprintf(bf + printed, size - printed, " [source: %s]", + annotate_opts.hide_src_code ? "OFF" : "On"); + } + + return printed; } static int annotate_browser__run(struct annotate_browser *browser, diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 1e59b9e5339d3..264a212b47df8 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2280,6 +2280,7 @@ void annotation_options__init(void) opt->annotate_src = true; opt->offset_level = ANNOTATION__OFFSET_JUMP_TARGETS; opt->percent_type = PERCENT_PERIOD_LOCAL; + opt->hide_src_code_on_title = true; } void annotation_options__exit(void) diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 0e6e3f60a897b..bbb89b32f398b 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -44,6 +44,7 @@ enum perf_disassembler { struct annotation_options { bool hide_src_code, + hide_src_code_on_title, use_offset, jump_arrows, print_lines, |