This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Embedded C code - functions that might sleep
- From: Mark Wielaard <mjw at redhat dot com>
- To: "Turgis, Frederic" <f-turgis at ti dot com>
- Cc: "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Wed, 01 Feb 2012 14:34:08 +0100
- Subject: Re: Embedded C code - functions that might sleep
- References: <28BE1A38672C8B4481BB423D0FD1F22E18F02E9A@DNCE03.ent.ti.com>
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