[Perftools]loc2c-test
Frank Ch. Eigler
fche@redhat.com
Tue Aug 9 13:23:00 GMT 2005
roland wrote:
> I resurrected the test program I had for the loc2c code when I was
> developing it in elfutils, and added it to systemtap. This is a simple
> test harness in C for this sort of use:
>
> -bash-3.00$ ./loc2c-test -k 0xc012af5d mask
> #define PROBEADDR 0xc012af5dULL
> static void print_value(struct pt_regs *regs)
> {
> intptr_t value;
> {
> value = fetch_register (2);
> }
> printk (" ---> %ld\n", (unsigned long) value);
> return;
> }
> For fixing bugs or adding features to the loc2c code, I'll use this to
> drive tests instead of using the translator. [...]
FWIW, the script code to express the same thing would be just this:
stap -p4 -e 'probe kernel.statement(0xc012af5d) { printk(string($mask)) }'
- FChE
More information about the Systemtap
mailing list