From: Serguei Makarov <smakarov@redhat.com>
To: systemtap@sourceware.org
Subject: Fwd: (PR11207) Macroprocessor discussion
Date: Thu, 14 Jun 2012 15:08:00 -0000 [thread overview]
Message-ID: <75cfd86b-a998-4777-8c76-dd674b1888a8@zmail19.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <beec6102-8bc2-4021-b2d6-aa39e32a435a@zmail19.collab.prod.int.phx2.redhat.com>
[oops, that should have been reply-to-all. Resending to the main mailing list:]
Frank,
All right, I agree with most of those suggestions.
The kernel-doc 'glue to previous comment' trick can be an acceptable stopgap while we decide whether/how to implement any deeper magic.
I'm not 100% sold on the special '%define ... %end' syntax, but I'm sufficiently sold to try implementing it :). Perhaps if we're taking that route we could go one step further and have it be
%define foo(bar,baz) {
... body of macro, where we track nested brackets {} correctly ...
}
(the important thing to note here being that we need to be smart about not counting brackets inside, say, string literals for determining the nesting depth)
or perhaps %macro foo(bar,baz) { ... }, to make it almost completely consistent with the probe and function syntax. (If it's still called %define, it's still fairly trivial to distinguish it from the %define(...) case -- one has a space after 'define', the other has a paren.)
So, basically, the next step is to figure out a minimal subset of functionality. I'm thinking:
- basic macro invocation syntax
- %define and %undef builtin macros
- the special %define ... %end syntax (whatever variation of it we decide on)
- kernel-doc glue comments (as a last-minute bonus)
This would be enough to rewrite, say, netfilter.stp to avoid having redundant code, with a minimum of fuss and time spent working on the macroprocessor. The basic scheme for doing so would be a wee bit messy, since each probe alias definition would look like this:
/** Specific docs */
%common_docs(blah)
/*** More specific docs */
probe netfilter.foo = ... {
%netfilter_probe_body(blah)
}
... which is still miles better than the existing copypasta.
parent reply other threads:[~2012-06-14 15:08 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <beec6102-8bc2-4021-b2d6-aa39e32a435a@zmail19.collab.prod.int.phx2.redhat.com>]
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=75cfd86b-a998-4777-8c76-dd674b1888a8@zmail19.collab.prod.int.phx2.redhat.com \
--to=smakarov@redhat.com \
--cc=systemtap@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).