Support ENABLED sdt probe macro

Stan Cox scox@redhat.com
Mon Aug 10 21:03:00 GMT 2009


SW10013
This is for utrace only; uprobes is related.

For test.d 'dtrace -h -s test.d' emits in test.h
 __extension__ extern long test_semaphore __attribute__ ((unused)) 
 __attribute__ ((section (".probes")));
 and for 'dtrace -G test.d' adds the definition
The changes for sdt.h are simple for a change, it checks that value
 before each probe setup.
session.h defines a map from filename to variable location
tapset-utrace.cxx will produce the following additional generated code:
 add 'struct task_struct *tsk;' to stap_utrace_probe
  since there is not a means to determine the task from
  systemtap_module_exit
 in _stp_utrace_probe_cb add for each probe if the filename matches.
 (There is not a means to determine what probe brought us here so
 incrementing only the concerned probe is a challenge)
       size_t sdt_semaphore = 1;
       __access_process_vm (tsk, 0x601230, &sdt_semaphore,
       sizeof (sdt_semaphore), 0);
       sdt_semaphore += 1;
 in systemtap_module_exit add for each probe if the filename matches
      size_t sdt_semaphore;
      __access_process_vm (tsk, 0x601230, &sdt_semaphore,
      sizeof (sdt_semaphore, 0);
      sdt_semaphore -= 1;
      __access_process_vm (tsk, 0x601230, &sdt_semaphore,
      sizeof (sdt_semaphore), 1);
In tapsets.cxx record the mapping from filename to variable location
In translate.cxx include a new "access_process_vm.h"  (see itrace.c)



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 10013.patch
URL: <http://sourceware.org/pipermail/systemtap/attachments/20090810/02f2d967/attachment.ksh>


More information about the Systemtap mailing list