This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Eliminating duplicate code in tapset files
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Mike Mason <mmlnx at us dot ibm dot com>
- Cc: systemtap at sourceware dot org
- Date: 10 Jul 2007 17:53:03 -0400
- Subject: Re: Eliminating duplicate code in tapset files
- References: <4693F670.2070209@us.ibm.com>
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.
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.
- FChE