]> Git Repo - linux.git/commitdiff
perf report: Fix switching to another perf.data file
authorArnaldo Carvalho de Melo <[email protected]>
Thu, 12 Apr 2018 17:58:24 +0000 (14:58 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 13 Apr 2018 13:00:04 +0000 (10:00 -0300)
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:
b01141f4f59c ("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 <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Martin Liška <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Thomas Richter <[email protected]>
Cc: Wang Nan <[email protected]>
Fixes: b01141f4f59c ("perf annotate: Initialize the priv are in symbol__new()")
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/symbol.c

index 62b2dd2253eb5d8b694ac53b76fb4738ca7c7766..1466814ebada5d30d3eb2dad96a6345c10eee6af 100644 (file)
@@ -2091,16 +2091,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;
This page took 0.060955 seconds and 4 git commands to generate.