Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp874008ybl; Fri, 10 Jan 2020 08:09:07 -0800 (PST) X-Google-Smtp-Source: APXvYqy0ZBPztOJt2h5GIln2b8NMsNLGQZWjfnQC9PH6aEec3s1T6reM4YFiAgfMQDPa6rgyz1ws X-Received: by 2002:a9d:51ca:: with SMTP id d10mr3116943oth.76.1578672546975; Fri, 10 Jan 2020 08:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578672546; cv=none; d=google.com; s=arc-20160816; b=pNnGq5LGd8eLKIi7vTy4y1ECTTwOFkJ2iClK4ePxYw/jueIFI3rY7w3KJlDUyqa6dQ JOtgSw2EgnzPN0qYKlssg+4XmKxHTC1w140yS8ZqNJSDjDyMgp7EY81IwzfMQOxoO+y3 h/SJArqBSY0LOCHLILB14tSDMfMz7GiT25309BRiE8AC68p31WZo+iYBRmFyuxOKntFo XAQ1aVDsu8sCrnII9Hpwiw7CA05NQ/T5WjbAbn9ngcUWcC5bTUj2OT/PUqxdFrSxZ6gx f8yVcjj3Dk9ohKkA5B+z7kDVFHBHLDMVvWJQ1DFsQojybAZkmyLUB55rE7tpShLs1C/d 3euA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gULohieAnBD3VrVqqurpxZwUjb1r3VGoubjLU87kocw=; b=O3s3JUX+Ralv0expFcyL2r511dx+WNP5Gr3c2isfNfaItee6TwBWwHZ+/HSjQhchfq fOanlz/c2u+eP/9RbxKC3LYtzQ8JyE1I10QnqH4NLOgWvI4mb7UwCOBtdYjKK19ljmdS 1WgL+O7SDeU7BqBo6ftiRu3MwN3cypBD1UJjWCSt3TlOGw1eY/5x1dqjLHf5Ln81LJQT 87KK461HLh0qPMkAQWOJpHL2hzPK4FQDSDJMudx70ejWLbXV9rWyzmY4xUPO0OMpHptc 6LpUCD6kkZSO3/1P12GOUuHRak1sNk0XL0KKvgFr+lV9UOON3FMXprAEU4SM8rWlTyaK qfTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zf6jI6ay; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si1240421ois.221.2020.01.10.08.08.53; Fri, 10 Jan 2020 08:09:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zf6jI6ay; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbgAJQFt (ORCPT + 99 others); Fri, 10 Jan 2020 11:05:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:54192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728452AbgAJQFs (ORCPT ); Fri, 10 Jan 2020 11:05:48 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E18C20838; Fri, 10 Jan 2020 16:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578672348; bh=VFEjD3rWysPcuxgSvHRR7T5OPSD7O8/ZP7SYzqnrnX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zf6jI6ay+SNjggK9lhe7t5Pi7N7yDzoIbnOWLwZ6IB+T2jGoZFQRysqWN3SRIKBjG BZywpv9Zz3t9OhotjlsrRuG6Lfggv1DayhaeHA9S3zFqYsTGrsbgDwbXdiF0t/MJ/L qLC8Cg73UUIA7DOU2oz8gVjR5zuL+03BnUG5S/Ho= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Frank Rowand , Randy Dunlap , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Rob Herring , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 12/22] tracing: kprobes: Register to dynevent earlier stage Date: Sat, 11 Jan 2020 01:05:42 +0900 Message-Id: <157867234213.17873.18039000024374948737.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157867220019.17873.13377985653744804396.stgit@devnote2> References: <157867220019.17873.13377985653744804396.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register kprobe event to dynevent in subsys_initcall level. This will allow kernel to register new kprobe events in fs_initcall level via trace_run_command. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_kprobe.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 5899911a5720..5584405b899d 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1685,11 +1685,12 @@ static __init void setup_boot_kprobe_events(void) enable_boot_kprobe_events(); } -/* Make a tracefs interface for controlling probe points */ -static __init int init_kprobe_trace(void) +/* + * Register dynevent at subsys_initcall. This allows kernel to setup kprobe + * events in fs_initcall without tracefs. + */ +static __init int init_kprobe_trace_early(void) { - struct dentry *d_tracer; - struct dentry *entry; int ret; ret = dyn_event_register(&trace_kprobe_ops); @@ -1699,6 +1700,16 @@ static __init int init_kprobe_trace(void) if (register_module_notifier(&trace_kprobe_module_nb)) return -EINVAL; + return 0; +} +subsys_initcall(init_kprobe_trace_early); + +/* Make a tracefs interface for controlling probe points */ +static __init int init_kprobe_trace(void) +{ + struct dentry *d_tracer; + struct dentry *entry; + d_tracer = tracing_init_dentry(); if (IS_ERR(d_tracer)) return 0;