Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271469

Re: trace: trace_kprobe.c always shows interrupts off

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: trace: trace_kprobe.c always shows interrupts off
Date 2015-11-17 18:30 +0100
Message-ID <qvSeS-81H-5@gated-at.bofh.it> (permalink)
References <qvRsu-7rX-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 17 Nov 2015 16:35:35 +0000 (UTC)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> Hi,
> 
> I notice that trace_kprobe.c does local_save_flags() within
> __kprobe_trace_func(), which is called (at least on x86) with
> interrupts always disabled. This is then used as interrupt on/off
> state within the recorded event, which is misleading.

Kinda. The kprobe itself has interrupts disabled, so it's only a white
lie.

> 
> I also don't understand why arch/x86/kernel/kprobes/ftrace.c
> pre handler disables interrupts, considering the following
> comment above arch/x86/kernel/kprobes/core.c: kprobe_int3_handler()
> 
>  * Interrupts are disabled on entry as trap3 is an interrupt gate and they
>  * remain disabled throughout this function.

I think you answered your own question. The key piece you may be
missing is that kprobe_ftrace_handler() is not called from a trap, but
from a function traced callback, which does not disable interrupts.

> 
> A struct pt_regs is received by this function, but I don't see
> any way to get the state of irq enable/disable from struct pt_regs
> across architectures.
> 
> Any thoughts on how to fix this ?

Create a cross arch: flags = regs_irq_save(regs) function.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

trace: trace_kprobe.c always shows interrupts off Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2015-11-17 17:40 +0100
  Re: trace: trace_kprobe.c always shows interrupts off Steven Rostedt <rostedt@goodmis.org> - 2015-11-17 18:30 +0100
    RE: trace: trace_kprobe.c always shows interrupts off 平松雅巳 / HIRAMATU,MASAMI   <masami.hiramatsu.pt@hitachi.com> - 2015-11-18 08:00 +0100
      Re: trace: trace_kprobe.c always shows interrupts off Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2015-11-18 14:20 +0100

csiph-web