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: Global constants


Hi -

> Along these same lines, it would be nice to have a more direct way to
> access macros, instead of resorting to embedded-C.  Perhaps something
> like:
> 	import O_CREAT, O_TRUNC, O_APPEND
> The translator could make references to "imported" values as direct
> macro accesses, instead of needing a global systemtap variable.

That would still burden the tapset programmer to add the necessary
%{ #include <linux/foo.h> %}'s to define all those macros.

It would be nice if the kernel were compiled with "-g2" or whatever is
needed to emit macro definitions into DWARF.  Then we could fully
process such things - even expose them as $O_CREAT without an explicit
"import" or "global".


> [...]
> Direct access to macros would make script parameters easy:
> 	# openwatch.stp
> 	import FILE_TO_WATCH
> 	probe syscall.open {
> 	    if (FILE_TO_WATCH == filename)
> [...]

This could be a plausible solution for bug #1304 (with the addition of
some type data).  But I would like to aim for something that can be
set at startup time rather than compile time.  That would be an
element of bug #2208, where precompiled probe modules may be reused.
That in turn is more useful if they can be parametrized.

- FChE


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