[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190702165008.GC34718@lakrids.cambridge.arm.com>
Date: Tue, 2 Jul 2019 17:50:09 +0100
From: Mark Rutland <mark.rutland@....com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Catalin Marinas <catalin.marinas@....com>
Subject: Re: [for-next][PATCH 12/16] kprobes: Initialize kprobes at
postcore_initcall
On Sun, May 26, 2019 at 03:18:40PM -0400, Steven Rostedt wrote:
> From: Masami Hiramatsu <mhiramat@...nel.org>
>
> Initialize kprobes at postcore_initcall level instead of module_init
> since kprobes is not a module, and it depends on only subsystems
> initialized in core_initcall.
> This will allow ftrace kprobe event to add new events when it is
> initializing because ftrace kprobe event is initialized at
> later initcall level.
>
> Link: http://lkml.kernel.org/r/155851394736.15728.13626739508905120098.stgit@devnote2
>
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> ---
> kernel/kprobes.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index b1ea30a5540e..54aaaad00a47 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -2289,6 +2289,7 @@ static int __init init_kprobes(void)
> init_test_probes();
> return err;
> }
> +postcore_initcall(init_kprobes);
As a heads-up, this is causing boot-time failures on arm64.
On arm64 kprobes depends on the BRK handler we register in
debug_traps_init(), which is an arch_initcall.
As of this change, init_krprobes() calls init_test_probes() before
that's registered, so we end up hitting a BRK before we can handle it.
Thanks,
Mark.
>
> #ifdef CONFIG_DEBUG_FS
> static void report_probe(struct seq_file *pi, struct kprobe *p,
> @@ -2614,5 +2615,3 @@ static int __init debugfs_kprobe_init(void)
>
> late_initcall(debugfs_kprobe_init);
> #endif /* CONFIG_DEBUG_FS */
> -
> -module_init(init_kprobes);
> --
> 2.20.1
>
>
Powered by blists - more mailing lists