diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-11-26 09:13:50 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-11-26 09:13:50 +0100 |
commit | a95a49fa0cc5eec730d8703b1544fa7ea6a11dec (patch) | |
tree | b083198754d81e19710bb7a3a0c5f5ef77f2aeae /tools/perf | |
parent | Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
parent | tools lib bpf: Don't do a feature check when cleaning (diff) | |
download | linux-a95a49fa0cc5eec730d8703b1544fa7ea6a11dec.tar.xz linux-a95a49fa0cc5eec730d8703b1544fa7ea6a11dec.zip |
Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
User visible changes:
- Fix to free temporal Dwarf_Frame correctly in 'perf probe', fixing a
regression introduced in perf/core that prevented, at least, adding
an uprobe collecting function parameter values (Masami Hiramatsu)
- Fix output of %llu for 64 bit values read on 32 bit machines in
libtraceevent (Steven Rostedt)
Developer visible:
- Clean CFLAGS and LDFLAGS for fixdep in tools/build (Wang Nan)
- Don't do a feature check when cleaning tools/lib/bpf (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/probe-finder.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 1cab05a3831e..2be10fb27172 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -654,6 +654,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod, static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf) { Dwarf_Attribute fb_attr; + Dwarf_Frame *frame = NULL; size_t nops; int ret; @@ -683,26 +684,24 @@ static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf) ret = dwarf_getlocation_addr(&fb_attr, pf->addr, &pf->fb_ops, &nops, 1); if (ret <= 0 || nops == 0) { pf->fb_ops = NULL; - ret = 0; #if _ELFUTILS_PREREQ(0, 142) } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa && pf->cfi != NULL) { - Dwarf_Frame *frame = NULL; if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { pr_warning("Failed to get call frame on 0x%jx\n", (uintmax_t)pf->addr); - ret = -ENOENT; + free(frame); + return -ENOENT; } - free(frame); #endif } /* Call finder's callback handler */ - if (ret >= 0) - ret = pf->callback(sc_die, pf); + ret = pf->callback(sc_die, pf); - /* *pf->fb_ops will be cached in libdw. Don't free it. */ + /* Since *pf->fb_ops can be a part of frame. we should free it here. */ + free(frame); pf->fb_ops = NULL; return ret; |