This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
kretprobes vs __switch_to
- From: Roland McGrath <roland at redhat dot com>
- To: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Wed, 14 Dec 2005 18:58:54 -0800 (PST)
- Subject: kretprobes vs __switch_to
> The second one that failed was 'kernel.function("__switch_to").return'.
> This one is a problem with kretprobes only, as all of my other probes in
> __switch_to behaved just fine, even in the middle of the function.
> Running this gave "Kernel BUG at kprobes:449" (the full dump is included
> below). The line mentioned is in trampoline_probe_handler:
>
> BUG_ON(!orig_ret_address || (orig_ret_address ==
> trampoline_address));
>
> It seems pretty obvious that the actions taken in __switch_to would
> conflict with the way the trampoline works. I don't know if it's
> possible to make kretprobes work on this function - if not, it should be
> blacklisted.
It's not clear to me why this fails. It's actually some assembly code in
the switch_to macro (used in context_switch) that changes stacks, before it
calls __switch_to. __switch_to is entered on the new stack and it seems to
me that kretprobes ought to be able to handle it normally. Clearly I'm
missing something.