Skip to contentSkip to conversation

perf unwind: Report error from dwfl_attach_state

PATCH Superseded Martin Vuille 1 participant 1 message Feb 11, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf unwind: Report error from dwfl_attach_state

In verbose level 2, errors returned by libdw are reported in most cases, but not when calling dwfl_attach_state.

Since elfutils v 0.160 (2014), dwfl_attach_state sets the error code to report failure cause. On failure, log the reported error.

---
 tools/perf/util/unwind-libdw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/unwind-libdw.c +2 -1
index 1e9c974faf67..967323c958fd 100644
@@ -236,7 +236,8 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
 	if (err)
 		goto out;
 
-	if (!dwfl_attach_state(ui->dwfl, EM_NONE, thread->tid, &callbacks, ui))
+	err = !dwfl_attach_state(ui->dwfl, EM_NONE, thread->tid, &callbacks, ui);
+	if (err)
 		goto out;
 
 	err = dwfl_getthread_frames(ui->dwfl, thread->tid, frame_callback, ui);
Signature · 1 line
2.13.6