summaryrefslogtreecommitdiff
path: root/tools/perf/util/scripting-engines/trace-event-perl.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-04-13 09:57:50 +0300
committerIngo Molnar <mingo@kernel.org>2016-04-13 09:57:50 +0300
commitaeaae7d612ff2ad647ba422099da56eb3aa89237 (patch)
treebad2e6634e57c9d0d24a67086620ffca86dc5313 /tools/perf/util/scripting-engines/trace-event-perl.c
parent889fac6d67d46a5e781c08fb26fec9016db1c307 (diff)
parent99e87f7bb7268cf644add87130590966fd5d0d17 (diff)
downloadlinux-aeaae7d612ff2ad647ba422099da56eb3aa89237.tar.xz
Merge tag 'perf-core-for-mingo-20160408' 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: - Beautify more syscall arguments in 'perf trace', using the type column in tracepoint /format fields to attach, for instance, a pid_t resolver to the thread COMM, also attach a mode_t beautifier in the same fashion (Arnaldo Carvalho de Melo) - Build the syscall table id <-> name resolver using the same .tbl file used in the kernel to generate headers, to avoid the delay in getting new syscalls supported in the audit-libs external dependency, done so far only for x86_64 (Arnaldo Carvalho de Melo) - Improve the documentation of event specifications (Andi Kleen) - Process update events in 'perf script', fixing up this use case: # perf stat -a -I 1000 -e cycles record | perf script -s script.py - Shared object symbol adjustment fixes, fixing symbol resolution in Android (Wang Nan) Infrastructure changes: - Add dedicated unwind addr_space member into thread struct, to allow tools to use thread->priv, noticed while working on having callchains in 'perf trace' (Jiri Olsa) Build fixes: - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-perl.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 1d160855cda9..35ed00a600fb 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -283,18 +283,27 @@ static SV *perl_process_callchain(struct perf_sample *sample,
if (!elem)
goto exit;
- hv_stores(elem, "ip", newSVuv(node->ip));
+ if (!hv_stores(elem, "ip", newSVuv(node->ip))) {
+ hv_undef(elem);
+ goto exit;
+ }
if (node->sym) {
HV *sym = newHV();
- if (!sym)
+ if (!sym) {
+ hv_undef(elem);
+ goto exit;
+ }
+ if (!hv_stores(sym, "start", newSVuv(node->sym->start)) ||
+ !hv_stores(sym, "end", newSVuv(node->sym->end)) ||
+ !hv_stores(sym, "binding", newSVuv(node->sym->binding)) ||
+ !hv_stores(sym, "name", newSVpvn(node->sym->name,
+ node->sym->namelen)) ||
+ !hv_stores(elem, "sym", newRV_noinc((SV*)sym))) {
+ hv_undef(sym);
+ hv_undef(elem);
goto exit;
- hv_stores(sym, "start", newSVuv(node->sym->start));
- hv_stores(sym, "end", newSVuv(node->sym->end));
- hv_stores(sym, "binding", newSVuv(node->sym->binding));
- hv_stores(sym, "name", newSVpvn(node->sym->name,
- node->sym->namelen));
- hv_stores(elem, "sym", newRV_noinc((SV*)sym));
+ }
}
if (node->map) {
@@ -306,7 +315,10 @@ static SV *perl_process_callchain(struct perf_sample *sample,
else if (map->dso->name)
dsoname = map->dso->name;
}
- hv_stores(elem, "dso", newSVpv(dsoname,0));
+ if (!hv_stores(elem, "dso", newSVpv(dsoname,0))) {
+ hv_undef(elem);
+ goto exit;
+ }
}
callchain_cursor_advance(&callchain_cursor);