Re: [PATCH 2/2] tracing/filters: use strcmp() instead of strncmp()

From: Li Zefan
Date: Tue Sep 08 2009 - 21:22:46 EST


> Not sure this is an issue. I may be a little out of context here, but
> isn't addr coming from the event? The event is made in the kernel and
> should be fine?
>
> What ever the case, the bug you originally mentioned is still there (I
> just tried it out on the latest tip). That is, name == et will match
> "eth0".
>

Strange. I fixed it with this commit:

========
commit 7d536cb3fb9993bdcd5a2fbaa6b0670ded4e101c
Author: Li Zefan <lizf@xxxxxxxxxxxxxx>
Date: Thu Jul 16 10:54:02 2009 +0800

tracing/events: record the size of dynamic arrays

When a dynamic array is defined, we add __data_loc_foo in
trace_entry to record the offset of the array, but the
size of the array is not recorded, which causes 2 problems:

- the event filter just compares the first 2 chars of the strings. <-- note here!!

- parsers can't parse dynamic arrays.

So we encode the size of each dynamic array in the higher 16 bits
of __data_loc_foo, while the offset is in lower 16 bits.
========

And I just double checked it to confirm that the bug has been fixed.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/