From: mulyadi.santosa@gmail.com (Mulyadi Santosa)
To: kernelnewbies@lists.kernelnewbies.org
Subject: question about macro __DO_TRACE
Date: Sat, 26 Feb 2011 11:54:37 +0700 [thread overview]
Message-ID: <AANLkTimFhn9gBPcq7W2xYsNN+p_A3d8fCPYQG94LUtC7@mail.gmail.com> (raw)
In-Reply-To: <20110226043757.GF1807@nowhere>
On Sat, Feb 26, 2011 at 11:37, Frederic Weisbecker <fweisbec@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
prev parent reply other threads:[~2011-02-26 4:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 2:40 question about macro __DO_TRACE zhao bao
2011-02-26 4:37 ` Frederic Weisbecker
2011-02-26 4:54 ` Mulyadi Santosa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimFhn9gBPcq7W2xYsNN+p_A3d8fCPYQG94LUtC7@mail.gmail.com \
--to=mulyadi.santosa@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).