aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-04-22 15:10:24 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-04-29 09:38:02 -0400
commit87d650be1dcc9bd9bb200e73b985ddb740d067bc (patch)
treefee02eaf06db60f9c75094d1b34096af3389597a /tools/perf/util/parse-events.c
parent492d977444734e03c0633a238f1431b3c66b3e97 (diff)
perf tools: Add symbolic events support for parse_events_error
Allowing symbolic events processing to report back error. $ perf record -e 'cycles/period=krava/' ls event syntax error: '../period=krava/' \___ expected numeric value $ perf record -e 'cycles/name=1/' ls event syntax error: '..es/name=1/' \___ expected string value Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1429729824-13932-10-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 278aebe5d65b..80a50fdb6d8a 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -625,7 +625,8 @@ static int config_attr(struct perf_event_attr *attr,
625 return 0; 625 return 0;
626} 626}
627 627
628int parse_events_add_numeric(struct list_head *list, int *idx, 628int parse_events_add_numeric(struct parse_events_evlist *data,
629 struct list_head *list,
629 u32 type, u64 config, 630 u32 type, u64 config,
630 struct list_head *head_config) 631 struct list_head *head_config)
631{ 632{
@@ -636,10 +637,10 @@ int parse_events_add_numeric(struct list_head *list, int *idx,
636 attr.config = config; 637 attr.config = config;
637 638
638 if (head_config && 639 if (head_config &&
639 config_attr(&attr, head_config, NULL)) 640 config_attr(&attr, head_config, data->error))
640 return -EINVAL; 641 return -EINVAL;
641 642
642 return add_event(list, idx, &attr, NULL); 643 return add_event(list, &data->idx, &attr, NULL);
643} 644}
644 645
645static int parse_events__is_name_term(struct parse_events_term *term) 646static int parse_events__is_name_term(struct parse_events_term *term)