Skip to contentSkip to conversation

perf unwind: Report error from dwfl_attach_state

PATCH RESEND Applied Martin Vuille 4 participants 4 messages Mar 18, 2018 – Mar 25, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 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 8e969f28cc59..7bdd239c795c 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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Sun, 18 Mar 2018 13:50:53 -0400 Martin Vuille <[email protected]> wrote:

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.

---

Kim

maintainer Applied
#2 lore raw

Em Tue, Mar 20, 2018 at 08:06:33AM +0800, Kim Phillips escreveu:

Quoted 6 lines
Quoted 3 lines · On Sun, 18 Mar 2018 13:50:53 -0400 Martin Vuille <[email protected]> wrote:

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

Quoted 7 lines
Quoted 5 lines

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

---

Thanks, applied.

- Arnaldo

#3 lore raw
In reply to Martin Vuille
perf unwind: Report error from dwfl_attach_state
Commit-ID:  555fc3b1ef4c850c635be333024dcf67bc1e7cb8
Gitweb:     https://git.kernel.org/tip/555fc3b1ef4c850c635be333024dcf67bc1e7cb8
Author:     Martin Vuille <[email protected]>
AuthorDate: Sun, 18 Mar 2018 13:50:53 -0400
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 20 Mar 2018 13:16:09 -0300

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 8e969f28cc59..7bdd239c795c 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);