aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-10-24 04:20:57 -0400
committerIngo Molnar <mingo@kernel.org>2012-10-24 04:20:57 -0400
commitef8c029fa793423439e67ef0416b220d3fa3321a (patch)
tree4199cefa6e1dcad1783040755246a14371f029af /tools/perf/builtin-trace.c
parent6fcdb1ed2ef3548d5a9428d6ae60158ddd46a608 (diff)
parentc13d38e4a1fd5dd07135403c613c8091af444169 (diff)
Merge branch 'perf/urgent' into perf/core
Pick up v3.7-rc2 and fixes before applying more patches. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 4e9320bf11e1..14b322961807 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -63,6 +63,10 @@ static int trace__read_syscall_info(struct trace *trace, int id)
63{ 63{
64 char tp_name[128]; 64 char tp_name[128];
65 struct syscall *sc; 65 struct syscall *sc;
66 const char *name = audit_syscall_to_name(id, trace->audit_machine);
67
68 if (name == NULL)
69 return -1;
66 70
67 if (id > trace->syscalls.max) { 71 if (id > trace->syscalls.max) {
68 struct syscall *nsyscalls = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc)); 72 struct syscall *nsyscalls = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc));
@@ -82,11 +86,8 @@ static int trace__read_syscall_info(struct trace *trace, int id)
82 } 86 }
83 87
84 sc = trace->syscalls.table + id; 88 sc = trace->syscalls.table + id;
85 sc->name = audit_syscall_to_name(id, trace->audit_machine); 89 sc->name = name;
86 if (sc->name == NULL) 90 sc->fmt = syscall_fmt__find(sc->name);
87 return -1;
88
89 sc->fmt = syscall_fmt__find(sc->name);
90 91
91 snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name); 92 snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name);
92 sc->tp_format = event_format__new("syscalls", tp_name); 93 sc->tp_format = event_format__new("syscalls", tp_name);
@@ -290,6 +291,13 @@ again:
290 if (evlist->threads->map[0] == -1 || evlist->threads->nr > 1) 291 if (evlist->threads->map[0] == -1 || evlist->threads->nr > 1)
291 printf("%d ", sample.tid); 292 printf("%d ", sample.tid);
292 293
294 if (sample.raw_data == NULL) {
295 printf("%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n",
296 perf_evsel__name(evsel), sample.tid,
297 sample.cpu, sample.raw_size);
298 continue;
299 }
300
293 handler = evsel->handler.func; 301 handler = evsel->handler.func;
294 handler(trace, evsel, &sample); 302 handler(trace, evsel, &sample);
295 } 303 }