diff options
Diffstat (limited to 'tools/perf/util/trace-event-parse.c')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 1a8d4dc4f386..a4088ced1e64 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <ctype.h> | ||
29 | #include <errno.h> | 28 | #include <errno.h> |
30 | 29 | ||
31 | #include "../perf.h" | 30 | #include "../perf.h" |
@@ -1424,6 +1423,11 @@ static long long arg_num_eval(struct print_arg *arg) | |||
1424 | die("unknown op '%s'", arg->op.op); | 1423 | die("unknown op '%s'", arg->op.op); |
1425 | } | 1424 | } |
1426 | break; | 1425 | break; |
1426 | case '+': | ||
1427 | left = arg_num_eval(arg->op.left); | ||
1428 | right = arg_num_eval(arg->op.right); | ||
1429 | val = left + right; | ||
1430 | break; | ||
1427 | default: | 1431 | default: |
1428 | die("unknown op '%s'", arg->op.op); | 1432 | die("unknown op '%s'", arg->op.op); |
1429 | } | 1433 | } |
@@ -1484,6 +1488,13 @@ process_fields(struct event *event, struct print_flag_sym **list, char **tok) | |||
1484 | 1488 | ||
1485 | free_token(token); | 1489 | free_token(token); |
1486 | type = process_arg(event, arg, &token); | 1490 | type = process_arg(event, arg, &token); |
1491 | |||
1492 | if (type == EVENT_OP) | ||
1493 | type = process_op(event, arg, &token); | ||
1494 | |||
1495 | if (type == EVENT_ERROR) | ||
1496 | goto out_free; | ||
1497 | |||
1487 | if (test_type_token(type, token, EVENT_DELIM, ",")) | 1498 | if (test_type_token(type, token, EVENT_DELIM, ",")) |
1488 | goto out_free; | 1499 | goto out_free; |
1489 | 1500 | ||