Skip to contentSkip to conversation

perf callchain: Add missing parent_val initialization

PATCH Applied Jiri Olsa 3 participants 3 messages Nov 21, 2015 – Nov 26, 2015 4 messages not in the archive perf events

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jiri Olsa

author
#4 lore raw

PATCH 1/1 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]
---
 tools/perf/util/callchain.h | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/callchain.h +1 -0
index 6e9b5f2099e1..8ac8f043004c 100644
@@ -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;
Signature · 1 line
2.4.3
maintainer Applied
#5 lore raw

Em Sat, Nov 21, 2015 at 11:23:55AM +0100, Jiri Olsa escreveu:

Quoted 2 lines

Adding missing parent_val callchain_node initialization. It's causing segfault in perf top:

Thanks, applied.

- Arnaldo

Quoted 38 lines
  $ 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]
---
 tools/perf/util/callchain.h | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/callchain.h +1 -0
index 6e9b5f2099e1..8ac8f043004c 100644
@@ -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;
Signature · 1 line
2.4.3
#6 lore raw
In reply to Jiri Olsa
perf callchain: Add missing parent_val initialization
Commit-ID:  646a6e846c4dc3812c614fd061603b6db5b8d380
Gitweb:     http://git.kernel.org/tip/646a6e846c4dc3812c614fd061603b6db5b8d380
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sat, 21 Nov 2015 11:23:55 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 23 Nov 2015 18:31:25 -0300

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]
Cc Masami Hiramatsu <[email protected]>
Cc Wang Nan <[email protected]>
Fixes 4b3a3212233a ("perf hists browser: Support flat callchains")
---
 tools/perf/util/callchain.h | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/callchain.h +1 -0
index 6e9b5f2..8ac8f043 100644
@@ -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;