This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Eliminating duplicate code in tapset files


Frank Ch. Eigler wrote:
mmlnx wrote:

macro VFS_COMMON
{
        file = $file
        count = $count
[...]
probe vfs.read = kernel.function ("vfs_read")
{
	%VFS_COMMON
        size = count
}
[...]

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. Let's keep it simple.



If not, if we're likely to stay happy with simple token pasting, it
can look alongside the current preprocessor conditional mechanism:
%( define VFS_COMMON /*...*/ %)
to define, and %( VFS_COMMON %)
to use.

This works for me, though I'm confused by the comment delimiters (/*...*/). Are you suggesting we use comment delimiters to delimit the macro contents? If so, then I'd rather see something else used, something unique.


Thanks,
Mike


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]