Setting values in library tapsets from user tapscript?

Frank Ch. Eigler fche@redhat.com
Wed Oct 30 22:34:00 GMT 2019


craig wrote:

> Related to my earlier post, is there any way to supply macro values to
> referenced tapsets?  [...]

Yeah, indirectly.  You correctly surmise that you're stuck with macros
and/or command line parameters to do this kind of thing, because for the
purpose you need them, they need to be compile-time literals (instead of
variables).  So, this works:

- create a new  foo.stpm  file in a new directory /zoo
- add into it:
   @define foo %( @1 %)
  or
   @define foo %( "/some/literal" %)
- create your probe.stp file that uses this macro:
- add into it:
   probe process(@foo "/bar").function("*"){}
- note the @foo reference
- run stap thusly:

   % stap -I/zoo probe.stp "/path/prefix"   # in the @1 case
or % stap -I/zoo probe.stp                  # in the hardcoded case

and bob is your uncle.  This works because "*.stpm" files located
in -any- tapset directory are parsed early and macro definitions
inside them is accessible to other files.


- FChE



More information about the Systemtap mailing list