diff options
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index dec8ced61fb0..7aaee39f6774 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -56,6 +56,10 @@ static int trace__read_syscall_info(struct trace *trace, int id) | |||
56 | { | 56 | { |
57 | char tp_name[128]; | 57 | char tp_name[128]; |
58 | struct syscall *sc; | 58 | struct syscall *sc; |
59 | const char *name = audit_syscall_to_name(id, trace->audit_machine); | ||
60 | |||
61 | if (name == NULL) | ||
62 | return -1; | ||
59 | 63 | ||
60 | if (id > trace->syscalls.max) { | 64 | if (id > trace->syscalls.max) { |
61 | struct syscall *nsyscalls = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc)); | 65 | struct syscall *nsyscalls = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc)); |
@@ -75,11 +79,8 @@ static int trace__read_syscall_info(struct trace *trace, int id) | |||
75 | } | 79 | } |
76 | 80 | ||
77 | sc = trace->syscalls.table + id; | 81 | sc = trace->syscalls.table + id; |
78 | sc->name = audit_syscall_to_name(id, trace->audit_machine); | 82 | sc->name = name; |
79 | if (sc->name == NULL) | 83 | sc->fmt = syscall_fmt__find(sc->name); |
80 | return -1; | ||
81 | |||
82 | sc->fmt = syscall_fmt__find(sc->name); | ||
83 | 84 | ||
84 | snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name); | 85 | snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name); |
85 | sc->tp_format = event_format__new("syscalls", tp_name); | 86 | sc->tp_format = event_format__new("syscalls", tp_name); |
@@ -267,6 +268,13 @@ again: | |||
267 | if (evlist->threads->map[0] == -1 || evlist->threads->nr > 1) | 268 | if (evlist->threads->map[0] == -1 || evlist->threads->nr > 1) |
268 | printf("%d ", sample.tid); | 269 | printf("%d ", sample.tid); |
269 | 270 | ||
271 | if (sample.raw_data == NULL) { | ||
272 | printf("%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", | ||
273 | perf_evsel__name(evsel), sample.tid, | ||
274 | sample.cpu, sample.raw_size); | ||
275 | continue; | ||
276 | } | ||
277 | |||
270 | handler = evsel->handler.func; | 278 | handler = evsel->handler.func; |
271 | handler(trace, evsel, &sample); | 279 | handler(trace, evsel, &sample); |
272 | } | 280 | } |