Commit 025e42a5 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Greg Kroah-Hartman

perf report: Fix switching to another file

[ Upstream commit 7b366142 ]

In the TUI the 's' hotkey can be used to switch to another
file in the current directory, but that got broken in Fixes:
b01141f4 ("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 file.

Cc: Adrian Hunter <>
Cc: Andi Kleen <>
Cc: David Ahern <>
Cc: Jin Yao <>
Cc: Jiri Olsa <>
Cc: Martin Liška <>
Cc: Namhyung Kim <>
Cc: Ravi Bangoria <>
Cc: Thomas Richter <>
Cc: Wang Nan <>
Fixes: b01141f4 ("perf annotate: Initialize the priv are in symbol__new()")
Link: default avatarArnaldo Carvalho de Melo <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 7bb0c4bd
......@@ -2093,16 +2093,14 @@ static bool symbol__read_kptr_restrict(void)
int symbol__annotation_init(void)
if (symbol_conf.init_annotation)
return 0;
if (symbol_conf.initialized) {
pr_err("Annotation needs to be init before symbol__init()\n");
return -1;
if (symbol_conf.init_annotation) {
pr_warning("Annotation being initialized multiple times\n");
return 0;
symbol_conf.priv_size += sizeof(struct annotation);
symbol_conf.init_annotation = true;
return 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment