Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755277AbbKRGvR (ORCPT ); Wed, 18 Nov 2015 01:51:17 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:39416 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753753AbbKRGvQ convert rfc822-to-8bit (ORCPT ); Wed, 18 Nov 2015 01:51:16 -0500 From: =?iso-2022-jp?B?GyRCSj8+PjJtTCYbKEIgLyBISVJBTUFUVRskQiEkGyhCTUFTQU1J?= To: "'Steven Rostedt'" , Mathieu Desnoyers CC: Ingo Molnar , Thomas Gleixner , Peter Zijlstra , LKML Subject: RE: trace: trace_kprobe.c always shows interrupts off Thread-Topic: trace: trace_kprobe.c always shows interrupts off Thread-Index: AdEhq+ZM8rQ1HuWuRfOx6AsyzKW/RQ== Date: Wed, 18 Nov 2015 06:51:12 +0000 Message-ID: <50399556C9727B4D88A595C8584AAB375262179B@GSjpTKYDCembx32.service.hitachi.net> References: <559989072.111063.1447778135704.JavaMail.zimbra@efficios.com> <20151117122333.71f5a903@gandalf.local.home> In-Reply-To: <20151117122333.71f5a903@gandalf.local.home> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.198.220.53] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1876 Lines: 55 Hi Mathieu, Steven, From: Steven Rostedt [mailto:rostedt@goodmis.org] > >On Tue, 17 Nov 2015 16:35:35 +0000 (UTC) >Mathieu Desnoyers 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. right, since the user can not forcibly change any kprobes to jump, those handlers should be ran under the same environment. >> 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. > Good idea! Anyway, we can start on x86, in other arch we can prepare a dummy function to return current interrupt state(as we are doing now). Thank you, ---- Masami Hiramatsu -- 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/