• Arnaldo Carvalho de Melo's avatar
    perf report: Fix switching to another perf.data file · 7b366142
    Arnaldo Carvalho de Melo authored
    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:
    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 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: b01141f4 ("perf annotate: Initialize the priv are in symbol__new()")
    Link: https://lkml.kernel.org/n/tip-ogppdtpzfax7y1h6gjdv5s6u@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    7b366142
symbol.c 50.1 KB