[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150324212956.GB12599@kernel.org>
Date: Tue, 24 Mar 2015 18:29:56 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: David Ahern <david.ahern@...cle.com>
Cc: linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH] perf tool: Add event name to error message for filters
Em Tue, Mar 24, 2015 at 12:10:17PM -0400, David Ahern escreveu:
> Use of a bad filter currently generates the message:
> Error: failed to set filter with 22 (Invalid argument)
>
> Add the event name to make it clear to which event the filter
> failed to apply:
> Error: Failed to set filter on event sched:sg_lb_stats: 22: Invalid argument
>
> Signed-off-by: David Ahern <david.ahern@...cle.com>
> Cc: Jiri Olsa <jolsa@...nel.org>
> Cc: Namhyung Kim <namhyung@...nel.org>
> +++ b/tools/perf/util/evsel.c
> @@ -807,9 +807,19 @@ static int perf_evsel__run_ioctl(struct perf_evsel *evsel, int ncpus, int nthrea
> int perf_evsel__set_filter(struct perf_evsel *evsel, int ncpus, int nthreads,
> const char *filter)
> {
> - return perf_evsel__run_ioctl(evsel, ncpus, nthreads,
> - PERF_EVENT_IOC_SET_FILTER,
> - (void *)filter);
> + int err;
> + char msg[512];
> +
> + err = perf_evsel__run_ioctl(evsel, ncpus, nthreads,
> + PERF_EVENT_IOC_SET_FILTER,
> + (void *)filter);
> + if (err) {
> + error("Failed to set filter on event %s: %d: %s\n",
> + perf_evsel__name(evsel), errno,
> + strerror_r(errno, msg, sizeof(msg)));
Humm, probably this will be the only call to error() from evsel.c,
making it require the error() routine, which in turn will break the
python binding, lemme check...
If that is the case we'll have to somehow propagate to the caller of
perf_evlist__apply_filters what was the evsel that had a filter that
caused the problem.
- Arnaldo
> + }
> +
> + return err;
> }
>
> int perf_evsel__enable(struct perf_evsel *evsel, int ncpus, int nthreads)
> --
> 2.2.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists