[PATCH V2 3/9] New commands `enable probe' and `disable probe'.
Jose E. Marchesi
jose.marchesi@oracle.com
Sat Oct 11 06:35:00 GMT 2014
Hi Doug.
Would it be useful to have "info probes" show
the enable/disable state of each probe?
Or at least know which ones have been disabled.
Right, `info probes' actually tells you the "Enabled" status of the
probes, provided there is at least one dtrace probe in the executable.
For example:
(gdb) info probes
Provider Name Where Semaphore Enabled Object
demo am-main 0x0000000000400c96 n/a /home/jemarch/oracle/usdt/demo
demo another 0x0000000000400c8b n/a always /home/jemarch/oracle/usdt/demo
demo progress-counter 0x0000000000400c81 n/a no /home/jemarch/oracle/usdt/demo
In the example above demo:am-main is a systemtap probe, for which
"Enabled" reads n/a. demo:another is a dtrace probe which cannot be
disabled (it does not have any associated enabler) and
demo:progress-counter is a dtrace probe which is disabled.
This is the source code used for the example above:
#include "stap-sdt.h"
#include "demo.h"
int main(int argc, char *argv[]) {
int i=0;
long int foo = 666;
char *jaja = "oh yeah";
while (i < 10) {
i++;
if (DEMO_PROGRESS_COUNTER_ENABLED())
DEMO_PROGRESS_COUNTER (i, foo, jaja);
DEMO_ANOTHER (i);
}
STAP_PROBE3(demo, am-main, i, foo, jaja);
i = 0;
}
More information about the Gdb-patches
mailing list