diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 38 | ||||
-rw-r--r-- | tools/perf/util/trace-event.h | 14 |
2 files changed, 35 insertions, 17 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 0739b12675f0..eda0a2488c19 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -613,7 +613,7 @@ static enum event_type read_token_item(char **tok) | |||
613 | static int test_type(enum event_type type, enum event_type expect) | 613 | static int test_type(enum event_type type, enum event_type expect) |
614 | { | 614 | { |
615 | if (type != expect) { | 615 | if (type != expect) { |
616 | die("Error: expected type %d but read %d", | 616 | warning("Error: expected type %d but read %d", |
617 | expect, type); | 617 | expect, type); |
618 | return -1; | 618 | return -1; |
619 | } | 619 | } |
@@ -624,13 +624,13 @@ static int test_type_token(enum event_type type, char *token, | |||
624 | enum event_type expect, const char *expect_tok) | 624 | enum event_type expect, const char *expect_tok) |
625 | { | 625 | { |
626 | if (type != expect) { | 626 | if (type != expect) { |
627 | die("Error: expected type %d but read %d", | 627 | warning("Error: expected type %d but read %d", |
628 | expect, type); | 628 | expect, type); |
629 | return -1; | 629 | return -1; |
630 | } | 630 | } |
631 | 631 | ||
632 | if (strcmp(token, expect_tok) != 0) { | 632 | if (strcmp(token, expect_tok) != 0) { |
633 | die("Error: expected '%s' but read '%s'", | 633 | warning("Error: expected '%s' but read '%s'", |
634 | expect_tok, token); | 634 | expect_tok, token); |
635 | return -1; | 635 | return -1; |
636 | } | 636 | } |
@@ -668,7 +668,7 @@ static int __read_expected(enum event_type expect, const char *str, int newline_ | |||
668 | 668 | ||
669 | free_token(token); | 669 | free_token(token); |
670 | 670 | ||
671 | return 0; | 671 | return ret; |
672 | } | 672 | } |
673 | 673 | ||
674 | static int read_expected(enum event_type expect, const char *str) | 674 | static int read_expected(enum event_type expect, const char *str) |
@@ -1258,12 +1258,12 @@ process_op(struct event *event, struct print_arg *arg, char **tok) | |||
1258 | type = process_array(event, arg, tok); | 1258 | type = process_array(event, arg, tok); |
1259 | 1259 | ||
1260 | } else { | 1260 | } else { |
1261 | die("unknown op '%s'", token); | 1261 | warning("unknown op '%s'", token); |
1262 | event->flags |= EVENT_FL_FAILED; | ||
1262 | /* the arg is now the left side */ | 1263 | /* the arg is now the left side */ |
1263 | return EVENT_NONE; | 1264 | return EVENT_NONE; |
1264 | } | 1265 | } |
1265 | 1266 | ||
1266 | |||
1267 | if (type == EVENT_OP) { | 1267 | if (type == EVENT_OP) { |
1268 | int prio; | 1268 | int prio; |
1269 | 1269 | ||
@@ -2873,7 +2873,7 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs, | |||
2873 | 2873 | ||
2874 | event = trace_find_event(type); | 2874 | event = trace_find_event(type); |
2875 | if (!event) { | 2875 | if (!event) { |
2876 | printf("ug! no event found for type %d\n", type); | 2876 | warning("ug! no event found for type %d", type); |
2877 | return; | 2877 | return; |
2878 | } | 2878 | } |
2879 | 2879 | ||
@@ -2887,6 +2887,12 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs, | |||
2887 | comm, pid, cpu, | 2887 | comm, pid, cpu, |
2888 | secs, nsecs, event->name); | 2888 | secs, nsecs, event->name); |
2889 | 2889 | ||
2890 | if (event->flags & EVENT_FL_FAILED) { | ||
2891 | printf("EVENT '%s' FAILED TO PARSE\n", | ||
2892 | event->name); | ||
2893 | return; | ||
2894 | } | ||
2895 | |||
2890 | pretty_print(data, size, event); | 2896 | pretty_print(data, size, event); |
2891 | printf("\n"); | 2897 | printf("\n"); |
2892 | } | 2898 | } |
@@ -3120,12 +3126,16 @@ int parse_event_file(char *buf, unsigned long size, char *sys) | |||
3120 | die("failed to read event id"); | 3126 | die("failed to read event id"); |
3121 | 3127 | ||
3122 | ret = event_read_format(event); | 3128 | ret = event_read_format(event); |
3123 | if (ret < 0) | 3129 | if (ret < 0) { |
3124 | die("failed to read event format"); | 3130 | warning("failed to read event format for %s", event->name); |
3131 | goto event_failed; | ||
3132 | } | ||
3125 | 3133 | ||
3126 | ret = event_read_print(event); | 3134 | ret = event_read_print(event); |
3127 | if (ret < 0) | 3135 | if (ret < 0) { |
3128 | die("failed to read event print fmt"); | 3136 | warning("failed to read event print fmt for %s", event->name); |
3137 | goto event_failed; | ||
3138 | } | ||
3129 | 3139 | ||
3130 | event->system = strdup(sys); | 3140 | event->system = strdup(sys); |
3131 | 3141 | ||
@@ -3135,6 +3145,12 @@ int parse_event_file(char *buf, unsigned long size, char *sys) | |||
3135 | 3145 | ||
3136 | add_event(event); | 3146 | add_event(event); |
3137 | return 0; | 3147 | return 0; |
3148 | |||
3149 | event_failed: | ||
3150 | event->flags |= EVENT_FL_FAILED; | ||
3151 | /* still add it even if it failed */ | ||
3152 | add_event(event); | ||
3153 | return -1; | ||
3138 | } | 3154 | } |
3139 | 3155 | ||
3140 | void parse_set_info(int nr_cpus, int long_sz) | 3156 | void parse_set_info(int nr_cpus, int long_sz) |
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index da77e073c867..29821acc8db6 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h | |||
@@ -139,12 +139,14 @@ struct event { | |||
139 | }; | 139 | }; |
140 | 140 | ||
141 | enum { | 141 | enum { |
142 | EVENT_FL_ISFTRACE = 1, | 142 | EVENT_FL_ISFTRACE = 0x01, |
143 | EVENT_FL_ISPRINT = 2, | 143 | EVENT_FL_ISPRINT = 0x02, |
144 | EVENT_FL_ISBPRINT = 4, | 144 | EVENT_FL_ISBPRINT = 0x04, |
145 | EVENT_FL_ISFUNC = 8, | 145 | EVENT_FL_ISFUNC = 0x08, |
146 | EVENT_FL_ISFUNCENT = 16, | 146 | EVENT_FL_ISFUNCENT = 0x10, |
147 | EVENT_FL_ISFUNCRET = 32, | 147 | EVENT_FL_ISFUNCRET = 0x20, |
148 | |||
149 | EVENT_FL_FAILED = 0x80000000 | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | struct record { | 152 | struct record { |