• Yang Jihong's avatar
    perf annotate: Fix sample events lost in stdio mode · 5676dba7
    Yang Jihong authored
    In hist__find_annotations(), since different 'struct hist_entry' entries
    may point to same symbol, we free notes->src to signal already processed
    this symbol in stdio mode; when annotate, entry will skipped if
    notes->src is NULL to avoid repeated output.
    
    However, there is a problem, for example, run the following command:
    
     # perf record -e branch-misses -e branch-instructions -a sleep 1
    
    perf.data file contains different types of sample event.
    
    If the same IP sample event exists in branch-misses and branch-instructions,
    this event uses the same symbol. When annotate branch-misses events, notes->src
    corresponding to this event is set to null, as a result, when annotate
    branch-instructions events, this event is skipped and no annotate is output.
    
    Solution of this patch is to remove zfree in hists__find_annotations and
    change sort order to "dso,symbol" to avoid duplicate output when different
    processes correspond to the same symbol.
    Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
    Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
    Cc: Jin Yao <yao.jin@linux.intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Martin Liška <mliska@suse.cz>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: zhangjinhao2@huawei.com
    Link: http://lore.kernel.org/lkml/20210319123527.173883-1-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    5676dba7
builtin-annotate.c 17.1 KB