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]

RE: Embedded C code - functions that might sleep


On Wed, 2012-02-01 at 14:47 +0000, Turgis, Frederic wrote:
> Thanks for the explanation and thread is giving good light on this.
> 
> My point is that systemtap design and doc seem to imply I can't call
> some functions in embedded C because of relevant systemtap design
> choices. In our script, we are in fact users, not developers of this
> called function. My goal is to know if there is no easy trick or
> "specific" mode of systemtap not mentioned in doc where I could still
> call them or if these functions (like opening OMAP GP timer) are
> definitely forbidden. Or if this is bad using them, but this is just
> profiling script on a dev mobile phone so who cares about hanging from
> time to time ? ;-)

I am afraid that in general you just cannot sleep in a probe handler. If
you still try "bad things" might happen. Like hanging or even crashing.
In some cases there are variants that also work in atomic context (for
example you can do some allocations with GFP_ATOMIC) but I don't know if
the OMAP GP timer provides such functionality/mode.

That said, if you are using guru mode already you are kind of on your
own anyway. In a lot of cases you might just get away with a little
badness. Just hope the function doesn't really sleep or schedule the
current task away...

Cheers,

Mark


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