On Fri, 2010-04-30 at 13:09 -0400, Mathieu Desnoyers wrote:
We do it all the time in the kernel with no type checking. Just look at
all the users of file->private.
If it is possible sure, but that's the point. Where do you add the
check? The typecast is in the C code that is constant for all trace
events.
Thanks for your vote of confidence.
Where do you add the typecheck?? As I said before, if the TRACE_EVENT()
macros are broken, then so will the typecheck, and it will not catch the
errors.
Sure the event macros can have bugs, but if it does then it will have
bugs for all. Because it is automated. If there is a bug, it wont be
because of a missed type being passed in, it would be because of one of
the extra macros we have that processes the same type incorrectly.
I saw the patch, but how does it help?
I use "proto" to make the tracepoint and the callback, so I can add
somewhere this "check_trace_callback_type_##name(proto)", but if the
macros break somehow, that means proto changed between two references of
it, but what keeps proto from breaking at both callback creation and the
typecheck.
Basically, you are saying that somehow the argument "proto" can change
between two uses of it. I don't really see that happening, and I'm not
paranoid enough to think that's an issue. Adding checks that don't
really check anything, honestly I find a waste, and just more confusion
in the macros.
-- Steve
--