lkml.org 
[lkml]   [2014]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: Add NOT to filtering logic
On Tue, 2 Dec 2014 11:49:58 -0800
Alexei Starovoitov <ast@plumgrid.com> wrote:

> On Tue, Dec 2, 2014 at 9:04 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > \
> > - return match; \
> > + return match == !pred->not; \
>
> are you sure this one works for !(var & 2) ?
> 'not' is either 0 or 1, so it works for other macro:
> (val == *addr) ^ pred->not
>
> whereas here 'match' is 'int' and
> match = (*addr & val)
> will not be 0 or 1...
>
> the patch is small, but delicate...

Yeah, there's some more I'm fixing up on it. I only did some basic
tests. I should have tested '& 2' instead of '& 1' ;-)

I'll make that check: return !!match == !pred->not.


> In such cases I trust tests more than code review ;)
> Could you add few tests for this to
> CONFIG_FTRACE_STARTUP_TEST
> part of the file ?

No, but I will be adding tests to the ftracetests in
tools/testing/selftests to test the filters.

Thanks,

-- Steve


\
 
 \ /
  Last update: 2014-12-02 21:41    [W:0.060 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site