question about macro __DO_TRACE

Mulyadi Santosa mulyadi.santosa at gmail.com
Fri Feb 25 23:54:37 EST 2011


On Sat, Feb 26, 2011 at 11:37, Frederic Weisbecker <fweisbec at gmail.com> wrote:
> And then it makes the trick inside __DO_TRACE(), we end up having:
>
>                                void *__data;
>
>                                __data = (it_func_ptr)->data;
>                                ((void(*)(proto))(it_func))(__data, myarg);
>
> See? That's a kind of ghost argument we inject in our CPP macros
> and in the end we cheat in order to pass that constant tracepoint data
> as a first argument of the probe.

Great tricks! well, sometimes we can't avoid doing such slick trick,
but all in all it's there.

Perhaps what we all need here is better and better code documentation.
Or at the very least, self documenting code

PS: Is that a specific gcc trick?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list