diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-04-22 15:10:19 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-04-29 09:38:00 -0400 |
commit | 36adec85a86f2daa521cda48ea7be8a95c20ed10 (patch) | |
tree | 951b6d123db8e0faed5d7153952af900819097aa /tools/perf/util/parse-events.c | |
parent | c056ba6a174f4d5d79fe27f259fc133041a451da (diff) |
perf tools: Change parse_events_add_pmu interface
Changing parse_events_add_pmu interface to allow propagating of the
parse_events_error info.
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-5-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.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 1e42f2ceec3d..749af0db94e7 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -633,8 +633,9 @@ static char *pmu_event_name(struct list_head *head_terms) | |||
633 | return NULL; | 633 | return NULL; |
634 | } | 634 | } |
635 | 635 | ||
636 | int parse_events_add_pmu(struct list_head *list, int *idx, | 636 | int parse_events_add_pmu(struct parse_events_evlist *data, |
637 | char *name, struct list_head *head_config) | 637 | struct list_head *list, char *name, |
638 | struct list_head *head_config) | ||
638 | { | 639 | { |
639 | struct perf_event_attr attr; | 640 | struct perf_event_attr attr; |
640 | struct perf_pmu_info info; | 641 | struct perf_pmu_info info; |
@@ -654,7 +655,7 @@ int parse_events_add_pmu(struct list_head *list, int *idx, | |||
654 | 655 | ||
655 | if (!head_config) { | 656 | if (!head_config) { |
656 | attr.type = pmu->type; | 657 | attr.type = pmu->type; |
657 | evsel = __add_event(list, idx, &attr, NULL, pmu->cpus); | 658 | evsel = __add_event(list, &data->idx, &attr, NULL, pmu->cpus); |
658 | return evsel ? 0 : -ENOMEM; | 659 | return evsel ? 0 : -ENOMEM; |
659 | } | 660 | } |
660 | 661 | ||
@@ -671,8 +672,8 @@ int parse_events_add_pmu(struct list_head *list, int *idx, | |||
671 | if (perf_pmu__config(pmu, &attr, head_config)) | 672 | if (perf_pmu__config(pmu, &attr, head_config)) |
672 | return -EINVAL; | 673 | return -EINVAL; |
673 | 674 | ||
674 | evsel = __add_event(list, idx, &attr, pmu_event_name(head_config), | 675 | evsel = __add_event(list, &data->idx, &attr, |
675 | pmu->cpus); | 676 | pmu_event_name(head_config), pmu->cpus); |
676 | if (evsel) { | 677 | if (evsel) { |
677 | evsel->unit = info.unit; | 678 | evsel->unit = info.unit; |
678 | evsel->scale = info.scale; | 679 | evsel->scale = info.scale; |