From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Sat, 26 Feb 2011 11:54:37 +0700 Subject: question about macro __DO_TRACE In-Reply-To: <20110226043757.GF1807@nowhere> References: <20110226043757.GF1807@nowhere> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sat, Feb 26, 2011 at 11:37, Frederic Weisbecker 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