[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bn9wykhy.fsf@ashishki-desk.ger.corp.intel.com>
Date: Fri, 11 Dec 2015 19:15:37 +0200
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
vince@...ter.net, eranian@...gle.com,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>
Subject: Re: [PATCH v0 3/5] perf: Introduce instruction trace filtering
Peter Zijlstra <peterz@...radead.org> writes:
> On Fri, Dec 11, 2015 at 03:36:36PM +0200, Alexander Shishkin wrote:
>> +static int
>> +perf_event_set_itrace_filter(struct perf_event *event, char *filter_str)
>> +{
>> + int ret = 0;
>> +
>> + /*
>> + * Since this is called in perf_ioctl() path, we're already holding
>> + * ctx::mutex.
>> + */
>> + lockdep_assert_held(&event->ctx->mutex);
>> +
>> + /*
>> + * For now, we only support filtering in per-task events; doing so
>> + * for cpu-wide events requires additional context switching trickery,
>> + * since same object code will be mapped at different virtual
>> + * addresses in different processes.
>> + */
>> + if (!event->ctx->task)
>> + return -EOPNOTSUPP;
>> +
>> + /* remove existing filters, if any */
>> + perf_itrace_filters_clear(event);
>> +
>> + ret = perf_event_parse_itrace_filter(event, filter_str);
>> + if (!ret) {
>> + perf_itrace_filters_apply(event);
>> +
>> + ret = perf_event_itrace_filters_setup(event);
>> + if (ret)
>> + perf_itrace_filters_clear(event);
>
> This is what I meant, if you try and set a 'wrong' filter while it
> already has filters set, you'll not only error out, you'll also wipe the
> current state.
>
> This seems wrong.
Ah, now I see what you mean. Yes, you're right.
Regards,
--
Alex
--
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