From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752728AbbIPH33 (ORCPT ); Wed, 16 Sep 2015 03:29:29 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39315 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbbIPH31 (ORCPT ); Wed, 16 Sep 2015 03:29:27 -0400 Date: Wed, 16 Sep 2015 00:29:10 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: a.p.zijlstra@chello.nl, jolsa@kernel.org, raphael.beamonte@gmail.com, mingo@kernel.org, dsahern@gmail.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, namhyung@kernel.org, matt@codeblueprint.co.uk Reply-To: matt@codeblueprint.co.uk, hpa@zytor.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, dsahern@gmail.com, acme@redhat.com, tglx@linutronix.de, a.p.zijlstra@chello.nl, raphael.beamonte@gmail.com, jolsa@kernel.org, mingo@kernel.org In-Reply-To: <1441615087-13886-4-git-send-email-jolsa@kernel.org> References: <1441615087-13886-4-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Propagate error info for the tracepoint parsing Git-Commit-ID: e2f9f8ea6a54e252e3a94a5c2321f673b5b97360 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e2f9f8ea6a54e252e3a94a5c2321f673b5b97360 Gitweb: http://git.kernel.org/tip/e2f9f8ea6a54e252e3a94a5c2321f673b5b97360 Author: Jiri Olsa AuthorDate: Mon, 7 Sep 2015 10:38:05 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 15 Sep 2015 09:48:32 -0300 perf tools: Propagate error info for the tracepoint parsing Pass 'struct parse_events_error *error' to the parse-event.c tracepoint adding path. It will be filled with error data in following patches. Signed-off-by: Jiri Olsa Reviewed-by: Raphael Beamonte Reviewed-by: Matt Fleming Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1441615087-13886-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/parse-events.c | 27 ++++++++++++++++----------- tools/perf/util/parse-events.h | 3 ++- tools/perf/util/parse-events.y | 4 ++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 3840176..1b284b8 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -387,7 +387,8 @@ int parse_events_add_cache(struct list_head *list, int *idx, } static int add_tracepoint(struct list_head *list, int *idx, - char *sys_name, char *evt_name) + char *sys_name, char *evt_name, + struct parse_events_error *error __maybe_unused) { struct perf_evsel *evsel; @@ -401,7 +402,8 @@ static int add_tracepoint(struct list_head *list, int *idx, } static int add_tracepoint_multi_event(struct list_head *list, int *idx, - char *sys_name, char *evt_name) + char *sys_name, char *evt_name, + struct parse_events_error *error) { char evt_path[MAXPATHLEN]; struct dirent *evt_ent; @@ -425,7 +427,7 @@ static int add_tracepoint_multi_event(struct list_head *list, int *idx, if (!strglobmatch(evt_ent->d_name, evt_name)) continue; - ret = add_tracepoint(list, idx, sys_name, evt_ent->d_name); + ret = add_tracepoint(list, idx, sys_name, evt_ent->d_name, error); } closedir(evt_dir); @@ -433,15 +435,17 @@ static int add_tracepoint_multi_event(struct list_head *list, int *idx, } static int add_tracepoint_event(struct list_head *list, int *idx, - char *sys_name, char *evt_name) + char *sys_name, char *evt_name, + struct parse_events_error *error) { return strpbrk(evt_name, "*?") ? - add_tracepoint_multi_event(list, idx, sys_name, evt_name) : - add_tracepoint(list, idx, sys_name, evt_name); + add_tracepoint_multi_event(list, idx, sys_name, evt_name, error) : + add_tracepoint(list, idx, sys_name, evt_name, error); } static int add_tracepoint_multi_sys(struct list_head *list, int *idx, - char *sys_name, char *evt_name) + char *sys_name, char *evt_name, + struct parse_events_error *error) { struct dirent *events_ent; DIR *events_dir; @@ -465,7 +469,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx, continue; ret = add_tracepoint_event(list, idx, events_ent->d_name, - evt_name); + evt_name, error); } closedir(events_dir); @@ -473,12 +477,13 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx, } int parse_events_add_tracepoint(struct list_head *list, int *idx, - char *sys, char *event) + char *sys, char *event, + struct parse_events_error *error) { if (strpbrk(sys, "*?")) - return add_tracepoint_multi_sys(list, idx, sys, event); + return add_tracepoint_multi_sys(list, idx, sys, event, error); else - return add_tracepoint_event(list, idx, sys, event); + return add_tracepoint_event(list, idx, sys, event, error); } static int diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index a09b0e2..ffee7ec 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -118,7 +118,8 @@ int parse_events__modifier_event(struct list_head *list, char *str, bool add); int parse_events__modifier_group(struct list_head *list, char *event_mod); int parse_events_name(struct list_head *list, char *name); int parse_events_add_tracepoint(struct list_head *list, int *idx, - char *sys, char *event); + char *sys, char *event, + struct parse_events_error *error); int parse_events_add_numeric(struct parse_events_evlist *data, struct list_head *list, u32 type, u64 config, diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 9cd7081..54a3004 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -376,7 +376,7 @@ PE_NAME '-' PE_NAME ':' PE_NAME snprintf(&sys_name, 128, "%s-%s", $1, $3); ALLOC_LIST(list); - ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5)); + ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5, data->error)); $$ = list; } | @@ -386,7 +386,7 @@ PE_NAME ':' PE_NAME struct list_head *list; ALLOC_LIST(list); - if (parse_events_add_tracepoint(list, &data->idx, $1, $3)) { + if (parse_events_add_tracepoint(list, &data->idx, $1, $3, data->error)) { struct parse_events_error *error = data->error; if (error) {