diff options
author | Jiri Olsa <jolsa@redhat.com> | 2015-11-21 13:23:55 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-24 00:31:25 +0300 |
commit | 646a6e846c4dc3812c614fd061603b6db5b8d380 (patch) | |
tree | f25e0882c41f219103dd7e2fc5d8d1de05224240 /tools/perf/util/callchain.h | |
parent | 7d6852432acb3b09fc3ec45dd65421d34eebe3b5 (diff) | |
download | linux-646a6e846c4dc3812c614fd061603b6db5b8d380.tar.xz |
perf callchain: Add missing parent_val initialization
Adding missing parent_val callchain_node initialization.
It's causing segfault in perf top:
$ sudo perf top -g
perf: Segmentation fault
-------- backtrace --------
free_callchain_node(+0x29) in perf [0x4a4b3e]
free_callchain(+0x29) in perf [0x4a5a83]
hist_entry__delete(+0x126) in perf [0x4c6649]
hists__delete_entry(+0x6e) in perf [0x4c66dc]
hists__decay_entries(+0x7d) in perf [0x4c6776]
perf_top__sort_new_samples(+0x7c) in perf [0x436a78]
hist_browser__run(+0xf2) in perf [0x507760]
perf_evsel__hists_browse(+0x1da) in perf [0x507c8d]
perf_evlist__tui_browse_hists(+0x3e) in perf [0x5088cf]
display_thread_tui(+0x7f) in perf [0x437953]
start_thread(+0xc5) in libpthread-2.21.so [0x7f7068fbb555]
__clone(+0x6d) in libc-2.21.so [0x7f7066fc3b9d]
[0x0]
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 4b3a3212233a ("perf hists browser: Support flat callchains")
Link: http://lkml.kernel.org/r/20151121102355.GA17313@krava.local
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/callchain.h')
-rw-r--r-- | tools/perf/util/callchain.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index 6e9b5f2099e1..8ac8f043004c 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -143,6 +143,7 @@ extern __thread struct callchain_cursor callchain_cursor; static inline void callchain_init(struct callchain_root *root) { INIT_LIST_HEAD(&root->node.val); + INIT_LIST_HEAD(&root->node.parent_val); root->node.parent = NULL; root->node.hit = 0; |