diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 29 |
2 files changed, 2 insertions, 29 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index df6064ad9bf2..fcd29e8af29f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -936,6 +936,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) | |||
936 | list_for_each_entry(pos, &evsel_list, node) { | 936 | list_for_each_entry(pos, &evsel_list, node) { |
937 | if (perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0) | 937 | if (perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0) |
938 | goto out_free_fd; | 938 | goto out_free_fd; |
939 | if (perf_header__push_event(pos->attr.config, event_name(pos))) | ||
940 | goto out_free_fd; | ||
939 | } | 941 | } |
940 | event_array = malloc((sizeof(struct pollfd) * MAX_NR_CPUS * | 942 | event_array = malloc((sizeof(struct pollfd) * MAX_NR_CPUS * |
941 | MAX_COUNTERS * threads->nr)); | 943 | MAX_COUNTERS * threads->nr)); |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 1f4cfe5d32fc..bc2732ee23eb 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -490,32 +490,6 @@ parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp, | |||
490 | return EVT_HANDLED_ALL; | 490 | return EVT_HANDLED_ALL; |
491 | } | 491 | } |
492 | 492 | ||
493 | static int store_event_type(const char *orgname) | ||
494 | { | ||
495 | char filename[PATH_MAX], *c; | ||
496 | FILE *file; | ||
497 | int id, n; | ||
498 | |||
499 | sprintf(filename, "%s/", debugfs_path); | ||
500 | strncat(filename, orgname, strlen(orgname)); | ||
501 | strcat(filename, "/id"); | ||
502 | |||
503 | c = strchr(filename, ':'); | ||
504 | if (c) | ||
505 | *c = '/'; | ||
506 | |||
507 | file = fopen(filename, "r"); | ||
508 | if (!file) | ||
509 | return 0; | ||
510 | n = fscanf(file, "%i", &id); | ||
511 | fclose(file); | ||
512 | if (n < 1) { | ||
513 | pr_err("cannot store event ID\n"); | ||
514 | return -EINVAL; | ||
515 | } | ||
516 | return perf_header__push_event(id, orgname); | ||
517 | } | ||
518 | |||
519 | static enum event_result parse_tracepoint_event(const char **strp, | 493 | static enum event_result parse_tracepoint_event(const char **strp, |
520 | struct perf_event_attr *attr) | 494 | struct perf_event_attr *attr) |
521 | { | 495 | { |
@@ -559,9 +533,6 @@ static enum event_result parse_tracepoint_event(const char **strp, | |||
559 | return parse_multiple_tracepoint_event(sys_name, evt_name, | 533 | return parse_multiple_tracepoint_event(sys_name, evt_name, |
560 | flags); | 534 | flags); |
561 | } else { | 535 | } else { |
562 | if (store_event_type(evt_name) < 0) | ||
563 | return EVT_FAILED; | ||
564 | |||
565 | return parse_single_tracepoint_event(sys_name, evt_name, | 536 | return parse_single_tracepoint_event(sys_name, evt_name, |
566 | evt_length, attr, strp); | 537 | evt_length, attr, strp); |
567 | } | 538 | } |