diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/builtin-help.c | 2 | ||||
| -rw-r--r-- | tools/perf/builtin-trace.c | 18 | ||||
| -rw-r--r-- | tools/perf/util/parse-events-test.c | 12 | ||||
| -rw-r--r-- | tools/perf/util/thread.c | 1 |
4 files changed, 22 insertions, 11 deletions
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 411ee5664e98..178b88ae3d2f 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
| @@ -414,7 +414,7 @@ static int show_html_page(const char *perf_cmd) | |||
| 414 | int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused) | 414 | int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused) |
| 415 | { | 415 | { |
| 416 | bool show_all = false; | 416 | bool show_all = false; |
| 417 | enum help_format help_format = HELP_FORMAT_NONE; | 417 | enum help_format help_format = HELP_FORMAT_MAN; |
| 418 | struct option builtin_help_options[] = { | 418 | struct option builtin_help_options[] = { |
| 419 | OPT_BOOLEAN('a', "all", &show_all, "print all available commands"), | 419 | OPT_BOOLEAN('a', "all", &show_all, "print all available commands"), |
| 420 | OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN), | 420 | OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN), |
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 | } |
diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c index 28c18d1d52c3..516ecd9ddd6e 100644 --- a/tools/perf/util/parse-events-test.c +++ b/tools/perf/util/parse-events-test.c | |||
| @@ -513,7 +513,8 @@ static int test__group1(struct perf_evlist *evlist) | |||
| 513 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 513 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
| 514 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 514 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
| 515 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 515 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
| 516 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 516 | /* use of precise requires exclude_guest */ |
| 517 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
| 517 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 518 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
| 518 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); | 519 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); |
| 519 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 520 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
| @@ -599,7 +600,8 @@ static int test__group3(struct perf_evlist *evlist __maybe_unused) | |||
| 599 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 600 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
| 600 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 601 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
| 601 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 602 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
| 602 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 603 | /* use of precise requires exclude_guest */ |
| 604 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
| 603 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 605 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
| 604 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 3); | 606 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 3); |
| 605 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 607 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
| @@ -662,7 +664,8 @@ static int test__group4(struct perf_evlist *evlist __maybe_unused) | |||
| 662 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 664 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
| 663 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 665 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
| 664 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 666 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
| 665 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 667 | /* use of precise requires exclude_guest */ |
| 668 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
| 666 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 669 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
| 667 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); | 670 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); |
| 668 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 671 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
| @@ -676,7 +679,8 @@ static int test__group4(struct perf_evlist *evlist __maybe_unused) | |||
| 676 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 679 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
| 677 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 680 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
| 678 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 681 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
| 679 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 682 | /* use of precise requires exclude_guest */ |
| 683 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
| 680 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 684 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
| 681 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); | 685 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); |
| 682 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 686 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index fb4b7ea6752f..8b3e5939afb6 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
| @@ -39,7 +39,6 @@ int thread__set_comm(struct thread *self, const char *comm) | |||
| 39 | err = self->comm == NULL ? -ENOMEM : 0; | 39 | err = self->comm == NULL ? -ENOMEM : 0; |
| 40 | if (!err) { | 40 | if (!err) { |
| 41 | self->comm_set = true; | 41 | self->comm_set = true; |
| 42 | map_groups__flush(&self->mg); | ||
| 43 | } | 42 | } |
| 44 | return err; | 43 | return err; |
| 45 | } | 44 | } |
