public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Fwd: (PR11207) Macroprocessor discussion
       [not found] <beec6102-8bc2-4021-b2d6-aa39e32a435a@zmail19.collab.prod.int.phx2.redhat.com>
@ 2012-06-14 15:08 ` Serguei Makarov
  0 siblings, 0 replies; only message in thread
From: Serguei Makarov @ 2012-06-14 15:08 UTC (permalink / raw)
  To: systemtap

[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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-14 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <beec6102-8bc2-4021-b2d6-aa39e32a435a@zmail19.collab.prod.int.phx2.redhat.com>
2012-06-14 15:08 ` Fwd: (PR11207) Macroprocessor discussion Serguei Makarov

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).