This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [Perftools]loc2c-test
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Roland McGrath <roland at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: 09 Aug 2005 09:23:42 -0400
- Subject: Re: [Perftools]loc2c-test
- References: <mailman.1123549860.1683.perftools-list@redhat.com>
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