Re: [PATCH 1/3] perf, pt, coresight: Clean up address filter structure
From: Alexander Shishkin
Date: Wed Feb 01 2017 - 07:46:56 EST
Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> writes:
> On 27 January 2017 at 05:12, Alexander Shishkin
> <alexander.shishkin@xxxxxxxxxxxxxxx> wrote:
>> But "range" is not an action, it's a type of a filter. It determines the
>> condition that triggers an action. An action, however, is what we do
>> when the condition comes true.
>
> Then filter->action could be renamed 'type'.
No. Again, *action* is what we *do*. *Type* is *how* we detect that
something needs to be done.
> In the end filters on PT
> are range filters, the same way they are on CS. But changing the
No. The CS driver supports both single address and address range
filters at least acconding to my reading of the code. Now that I look
more at it, I see that it also gets the range filters wrong: it
disregards filter->filter for range filters, assuming that since it's a
range, it means that the user wants to trace what's in the range
(filter->filter == 1), but it may also mean "stop if you end up in this
range" (filter->filter == 0). The fact that the CS driver gets it wrong
just proves the point that "filter->filter" is confusing and misleading
and needs to be replaced.
In the case of CS, I think that a -EOPNOTSUPP is also appropriate for
the type==range&&action==stop combination.
Regards,
--
Alex