This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
RE: [kprobe bug] pre-handler changes on globals lost
- From: "Lynch, Rusty" <rusty dot lynch at intel dot com>
- To: <systemtap at sources dot redhat dot com>
- Date: Wed, 15 Jun 2005 16:36:23 -0700
- Subject: RE: [kprobe bug] pre-handler changes on globals lost
>While working with some kprobe unit test, I stumbled across some wacky
>behavior that the below module exposes.
>
>If you build and install this module, you can run tc1 (the working
case)
>by doing a "cat /proc/run_tc1". You can then run the broken case by
>doing a "cat /proc/run_tc2".
>
>When the module is installed a kprobe with a pre_handler that
increments
>a global counter is registered for a target function.
>
>When the tescase is run it stores the current value of the global
counter,
>calls a simple function (the target function that has been armed with a
>kprobe) that just returns the value of the global counter, and then the
>testcase verifies that the returned value has incremented (thanks to
the
>kprobe.)
>
>By adding a simple printk("peep\n"); to the target function, the
effects
>of the pre_handler on the global counter are lost.
Quick correction: The bug is seen when I take AWAY the printk, not add
it.
--rusty