Thread (3 messages) 3 messages, 3 authors, 2011-02-26

question about macro __DO_TRACE

From: Mulyadi Santosa <hidden>
Date: 2011-02-26 04:54:37

On Sat, Feb 26, 2011 at 11:37, Frederic Weisbecker [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help