Skip to content

Commit 025e42a

Browse files
acmelgregkh
authored andcommitted
perf report: Fix switching to another perf.data file
[ Upstream commit 7b36614 ] In the TUI the 's' hotkey can be used to switch to another perf.data file in the current directory, but that got broken in Fixes: b01141f ("perf annotate: Initialize the priv are in symbol__new()"), that would show this once another file was chosen: ┌─Fatal Error─────────────────────────────────────┐ │Annotation needs to be init before symbol__init()│ │ │ │ │ │Press any key... │ └─────────────────────────────────────────────────┘ Fix it by just silently bailing out if symbol__annotation_init() was already called, just like is done with symbol__init(), i.e. they are done just once at session start, not when switching to a new perf.data file. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Martin Liška <mliska@suse.cz> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> Cc: Thomas Richter <tmricht@linux.vnet.ibm.com> Cc: Wang Nan <wangnan0@huawei.com> Fixes: b01141f ("perf annotate: Initialize the priv are in symbol__new()") Link: https://lkml.kernel.org/n/tip-ogppdtpzfax7y1h6gjdv5s6u@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7bb0c4b commit 025e42a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎tools/perf/util/symbol.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,16 +2093,14 @@ static bool symbol__read_kptr_restrict(void)
20932093

20942094
int symbol__annotation_init(void)
20952095
{
2096+
if (symbol_conf.init_annotation)
2097+
return 0;
2098+
20962099
if (symbol_conf.initialized) {
20972100
pr_err("Annotation needs to be init before symbol__init()\n");
20982101
return -1;
20992102
}
21002103

2101-
if (symbol_conf.init_annotation) {
2102-
pr_warning("Annotation being initialized multiple times\n");
2103-
return 0;
2104-
}
2105-
21062104
symbol_conf.priv_size += sizeof(struct annotation);
21072105
symbol_conf.init_annotation = true;
21082106
return 0;

0 commit comments

Comments
 (0)