lkml.org 
[lkml]   [2009]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] tracing/filters: Improve subsystem filter
Steven Rostedt wrote:
> On Mon, 20 Jul 2009, Steven Rostedt wrote:
>
>>
>> On Mon, 20 Jul 2009, Li Zefan wrote:
>>
>>> Currently a subsystem filter should be applicable to all events
>>> under the subsystem, and if it failed, all the event filters
>>> will be cleared. Those behaviors make subsys filter much less
>>> useful:
>>>
>>> # echo 'vec == 1' > irq/softirq_entry/filter
>>> # echo 'irq == 5' > irq/filter
>>> bash: echo: write error: Invalid argument
>>> # cat irq/softirq_entry/filter
>>> none
>>>
>>> I'd expect it set the filter for irq_handler_entry/exit, and
>>> not touch softirq_entry/exit.
>>>
>>> The basic idea is, try to see if the filter can be applied
>>> to which events, and then just apply to the those events:
>>>
>>> # echo 'vec == 1' > softirq_entry/filter
>>> # echo 'irq == 5' > filter
>>> # cat irq_handler_entry/filter
>>> irq == 5
>>> # cat softirq_entry/filter
>>> vec == 1
>
> OK, I tried this and it worked as you described, but it also does
> something that I did not like. Basically this:
>
> # echo 'vec == 1' > filter
> # cat softirq_entry/filter
> vec == 1
> # cat irq_handler_entry/filter
> none
> # cat filter
> vec == 1
> # echo 'irq == 5' > filter
> # cat irq_handler_entry/filter
> irq == 5
> # cat softirq_entry/filter
> vec == 1
> # cat filter
> irq == 5
>
>
> That last "cat filter" should show:
> vec == 1
> irq == 5
>

But I did not change the read semantic. For example, when
subsystem filter is not set at all:

# echo 'irq == 5' > irq_handler_entry/filter
# echo 'vec == 1' > softirq_entry/filter
# cat filter
none

It'll show "none".

> I can keep this version, since I do find it useful (I've now come to the
> conclusion that having the filter work only for those filters that it
> would work for is fine). But the top level filter should show all filters.
>

As I said in an old mail, I think the subsystem filter is much more
useful in "write" than in "read".

I have no strong option about its read semantic, but I can do what
you like.

Suppose:
irq_handler_entry/filter -> irq == 5
irq_handler_exit/filter -> none
softirq_entry/filter -> vec == 1
softirq_exit/filter -> vec == 2

Proposal 1:

# cat filter
irq == 5
vec == 1
vec == 2

Proposal 2:

# cat filter
irq_handler_entry: irq == 5
irq_handler_exit: none
softirq_entry: vec == 1
softirq_exit: vec == 2

Which do you think is better? Or do you have some better idea?

And in the failure case:

# echo 'irq == not_num' > filter
bash: echo: write error: Invalid argument

1:
# cat filter
(still shows filters in each event like above)

or shows error message (the current behavior)

2:
# cat filter
irq == not_num
^
parse_error: Couldn't find or set field in one of a subsystem's events

?



\
 
 \ /
  Last update: 2009-07-21 03:29    [W:1.376 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site