Embedded C code - functions that might sleep
Mark Wielaard
mjw@redhat.com
Wed Feb 1 13:34:00 GMT 2012
Hi Frederic,
On Wed, 2012-02-01 at 12:27 +0000, Turgis, Frederic wrote:
> systemtap doc states: "Note that all SystemTap functions and probes run with interrupts disabled, thus you cannot call functions that might sleep within the embedded C."
>
> This would explain issues we get with below probe on ARM platform (OMAP):
> - open a GP timer through function that calls mutex_lock() in "begin" probe -> it gives "BUG: sleeping function called from invalid context".
In general probes can occur anywhere, so might be triggered in interrupt
context. You would see the above message also if you are holding any
locks (sleeping while holding locks is bad, since there is no guarantee
the lock will ever be released again). If you are running a kernel with
lockdep enabled it should tell you exactly why it is yelling at you.
(Note that only very recently, like 30 minutes ago, we fixed some
lockdep issue with user probes, see the thread on the mailinglist).
Cheers,
Mark
More information about the Systemtap
mailing list