On Tue, 14 Jun 2016 11:38:32 -0500
Jeremy Linton <jeremy.linton@xxxxxxx> wrote:
There are a fair number of tracepoints in the kernel making
use of the sizeof operator. Allow perf to understand some of
those cases, and report a more informative error message for
the ones it cannot understand.
Signed-off-by: Jeremy Linton <jeremy.linton@xxxxxxx>
---
So this is as much a RFC as a patch because the use of sizeof
seems to extend to structures, pointers, etc that aren't easy
to deduce from userspace. I'm not sure what the correct solution
should be in those cases.
tools/lib/traceevent/event-parse.c | 46 ++++++++++++++++++++++++++++++++++++++
+
+ if (strcmp(token, "__u64") == 0) {
+ if (asprintf(&arg->atom.atom, "%zd", sizeof(__u64)) < 0)
+ goto out_free_atom;
+ } else if (strcmp(token, "__u32") == 0) {
+ if (asprintf(&arg->atom.atom, "%zd", sizeof(__u32)) < 0)
+ goto out_free_atom;
What events are doing sizeof(__u64) and sizeof(__u32)?
First, that's useless, as sizeof(__u64) will always be 8, and
sizeof(__u32) will always be 4.
What exactly is this fixing?