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]

Instrumenting context switches


Using some example code, I tried to instrument context switching by adding 
a probe to the method __switch_to.  Some documentation had suggested that 
certain versions of the systemtap could not handle instrumenting 
context_switch.  In the past I have gotten this to work but now the use of 
_stp_printf seems to cause the machine to freeze hard.  If I leave out the 
printing of switchCount but leave in the increment, things work fine.  Is 
this a known problem or a known historical problem and if so what are the 
workarounds?


probe kernel.function("__switch_to")
{
        doSwitchTo(gettimeofday_us(), $prev_p, $next_p);
}

function doSwitchTo(timeus:long, prev:long, next:long)
%{
        _stp_printf("SWITCHCOUNT = %ld\n", switchCount); 
<------------------------------ BAD LINE
        switchCount++;
}%




Perry


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