This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
printk in kernel.function("__switch_to") probe crashes machine
- From: Dave Nomura <dcnltc at us dot ibm dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 25 Apr 2007 16:17:39 -0700
- Subject: printk in kernel.function("__switch_to") probe crashes machine
- Organization: LTC Power Linux Toolchain
- Reply-to: dcnltc at us dot ibm dot com
3. I have written a kernel function probe in __switch_to and find that I
can define it as:
probe kernel.function("__switch_to")
{
print("calling ITrace_switch\n");
// ITrace_switch()
}
If I run this script I get:
Running sudo /usr/bin/staprun -u dcn -d 3614 -c
"/home/dcn/itrace/ITrace_test/hanoi/hanoi64 -2" /tmp/stapAiagsM/pitrace.ko
start itrace
calling ITrace_switch
....
calling ITrace_switch
end itrace
and this works just as expected.
However, if I uncomment ITrace_switch() call in my __switch_to probe,
and define it as:
function ITrace_switch()
%{
printk("ITrace_switch called\n");
%}
this crashes the machine.
I'm a SystemTap novice, and kernel novice so I'm not sure if there is
some obvious reason why this "printk" should cause the system to crash.
There are no messages on the console.
If there is a simple explanation I guess it might help me avoid doing
this sort of thing in the future. For now, I'll just avoid using printk
in this scenario.
Here is the machine info:
Linux elm3b158 2.6.16.43-0.5-ppc64 #1 SMP Mon Mar 19 08:28:24 UTC 2007
ppc64 ppc64 ppc64 GNU/Linux
SUSE Linux Enterprise Server 10 SP1 RC1 (ppc)