Eliminating duplicate code in tapset files

Mike Mason mmlnx@us.ibm.com
Mon Jul 16 20:37:00 GMT 2007


Frank Ch. Eigler wrote:
> Hi -
> 
> On Fri, Jul 13, 2007 at 09:11:20AM -0700, Mike Mason wrote:
>> [...]
>>> mmlnx wrote:
>>>
>>>> macro VFS_COMMON
>>>> {
>>>>        file = $file
>>> Let's consider the likelihood that this sort of widget would have to
>>> evolve into a full preprocessor with parametrized varargs macros,
>>> expression evaluation, and a special dose of whatnot.
>> This isn't needed for what I'm trying to do.  [...]
> 
> I know that, but I'm wondering if others can imagine plausible
> *future* uses of fuller macros.
> 

I can envision something like the following:

#define PROBE_KFUNC(F,M) kernel.function(F).return?,module(M).function(F).return?

probe cifs.read = PROBE_KFUNC("cifs_read", "cifs")

If fact, I wish we had this now.

>>>    %( define VFS_COMMON /*...*/ %)
>> [...]
>> This works for me, though I'm confused by the comment delimiters (/*...*/). 
>> [...]
> 
> Sorry for the ambiguity, ignore them.  Here's a real one:
> 
>    %( define VFS_COMMON foo=$bar zoo=$moo %)
> 
> - FChE



More information about the Systemtap mailing list