This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Perftools]loc2c-test


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]