[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191106142434.GH30214@krava>
Date: Wed, 6 Nov 2019 15:24:34 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andi Kleen <ak@...ux.intel.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
John Garry <john.garry@...wei.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, clang-built-linux@...glegroups.com,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v5 10/10] perf tools: report initial event parsing error
On Wed, Oct 30, 2019 at 03:34:48PM -0700, Ian Rogers wrote:
SNIP
> +
> +void parse_events_print_error(struct parse_events_error *err,
> + const char *event)
> +{
> + if (!err->num_errors)
> + return;
> +
> + __parse_events_print_error(err->idx, err->str, err->help, event);
> + zfree(&err->str);
> + zfree(&err->help);
> +
> + if (err->num_errors > 1) {
> + fputs("\nInitial error:\n", stderr);
> + __parse_events_print_error(err->first_idx, err->first_str,
> + err->first_help, event);
> + zfree(&err->first_str);
> + zfree(&err->first_help);
> }
> }
>
> @@ -2071,7 +2104,9 @@ int parse_events_option(const struct option *opt, const char *str,
> int unset __maybe_unused)
> {
> struct evlist *evlist = *(struct evlist **)opt->value;
> - struct parse_events_error err = { .idx = 0, };
> + struct parse_events_error err;
> +
> + bzero(&err, sizeof(err));
> int ret = parse_events(evlist, str, &err);
this breaks compilation:
make[3]: Nothing to be done for 'plugins/libtraceevent-dynamic-list'.
util/parse-events.c: In function ‘parse_events_option’:
util/parse-events.c:2110:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
2110 | int ret = parse_events(evlist, str, &err);
| ^~~
thanks,
jirka
Powered by blists - more mailing lists