Message ID | 168874788299.159442.2485957441413653858.stgit@devnote2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3415686vqx; Fri, 7 Jul 2023 10:12:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlEMf4mGzndJRX+csDqg5OoUs7isTGQOYjPBWNEkkxgKAKdaiUY3fWGGC76Er/WV1MKs/FCF X-Received: by 2002:a17:906:7a0a:b0:993:d6bc:a48c with SMTP id d10-20020a1709067a0a00b00993d6bca48cmr1557244ejo.1.1688749939901; Fri, 07 Jul 2023 10:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688749939; cv=none; d=google.com; s=arc-20160816; b=ImqqDc0YTqwyXzoz3lTyvikoGC3Wg2apQ8eMfA2vWMkga71mUBrxplVCuSizRGFoqb o++t6OVt3iJUjqsn6wbklaB3lXdBp2fcWjWO8rdzcnfoNx4PcJaoWAiVz6YSsULsO6Qq qh1Ma6vUoHMwrAQndxEQGoHY8xZnDb2cVv0v7doO73yM4MoU+iAQnTS1jPxkVbHNnTN4 yUEkfQ4Ba9Cl+ic3N9QUb6fdpZ29ZWxxnVhNQaMcNNxuVzGTG4eY8z2/GzjoeQw96QkW SELhpp8SnaCf3L0tISQvqRBnyCCdMS/s1Wuw5S6CPj33LpCg48yb0vtQDeFel4Q3PL+s SPlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:subject:cc:to:from:dkim-signature; bh=YICz7VgRWTa9RKe13z5PZF5R1jc+7GrBCT1Duog9L6w=; fh=Jt5HucOxdbm8id3DQQtA6jk9WoLxkA1HdE3GUcPpVT0=; b=Hsd1Jm5Py2WZ3FT2D2KLtUQe65xpA6ImFtPFsh8HExd1bVZRbeXcHDV7svNfmByUsU MgiEwjmyLqjIhBDgP8ebRJE+HhSFb76d7W+fXm9aHPJCZFHG28sQ8J7tXjxpPOIwvkSa mKGZXlAtcB5bvJUd/WgqW2/9GQ06T9AJ1F9r2Z27zXkar2gIJcBi30t4aYJJJ/51bg/6 3JX3XDVQn6ACoBt8uyZVJesibx60yah/SBRnfEDJPfNZ7ULcocOE+Hu3n0RE31KpS8vH blmC7sc6KmRweNsYFMwNtC+XKyHhEo5qsbogOb0/CNrN3Uur0YalPyLs/RZNmBeoBP3L txSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D0H7JozZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a170906941700b00992b4abde3csi2486836ejx.916.2023.07.07.10.11.55; Fri, 07 Jul 2023 10:12:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D0H7JozZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232614AbjGGQiK (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Fri, 7 Jul 2023 12:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjGGQiI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Jul 2023 12:38:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 115A7118; Fri, 7 Jul 2023 09:38:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92847619FD; Fri, 7 Jul 2023 16:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D34D4C433C7; Fri, 7 Jul 2023 16:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688747886; bh=z5OvZI907J55BnsSh4IUeHhRHonp+m90un+FTNJFTqo=; h=From:To:Cc:Subject:Date:From; b=D0H7JozZVOTKA59VtoO+1CrvsSSK+Ro30XK0XxVQeSghbcyaOe2myJE67cDySo5Xq 2LvgVWo/siDjstj7KR/N81gjghLvYn2eaUrO7DVpS70KBQZIF2rGDEu2bc7yFB7sFK 69KHY8r9MDP8SuS//qMh6ecuA019UbsVXYkKgywL3gUu6avojpp+Ju5n1BglbLSLyk 2sDZIAa9N5fFFVhzTpKiSWKG0yPAp+rYqHQwZby/IKEgB1wvaolq8T5mqtfme7OTf1 E+s0PIURqjFllrciTx5FV4EHEkmSi3LD+C+vpNiVxrwzcifBcM6ET7DoZnupCdpCJc Pt/FCzUihN98A== From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> To: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@kernel.org>, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running Date: Sat, 8 Jul 2023 01:38:03 +0900 Message-Id: <168874788299.159442.2485957441413653858.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770782657067839870?= X-GMAIL-MSGID: =?utf-8?q?1770782657067839870?= |
Series |
fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running
|
|
Commit Message
Masami Hiramatsu (Google)
July 7, 2023, 4:38 p.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org> Add a comment the reason why fprobe_kprobe_handler() exits if any other kprobe is running. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Link: https://lore.kernel.org/all/20230706120916.3c6abf15@gandalf.local.home/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> --- kernel/trace/fprobe.c | 6 ++++++ 1 file changed, 6 insertions(+)
Comments
On Sat, 8 Jul 2023 01:38:03 +0900 "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > From: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > Add a comment the reason why fprobe_kprobe_handler() exits if any other > kprobe is running. > > Suggested-by: Steven Rostedt <rostedt@goodmis.org> > Link: https://lore.kernel.org/all/20230706120916.3c6abf15@gandalf.local.home/ > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> -- Steve > --- > kernel/trace/fprobe.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c > index 75517667b54f..133b31f44945 100644 > --- a/kernel/trace/fprobe.c > +++ b/kernel/trace/fprobe.c > @@ -100,6 +100,12 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip, > return; > } > > + /* > + * This user handler is shared with other kprobes and is not expected to be > + * called recursively. So if any other kprobe handler is running, this will > + * exit as kprobe does. See the section 'Share the callbacks with kprobes' > + * in Documentation/trace/fprobe.rst for more information. > + */ > if (unlikely(kprobe_running())) { > fp->nmissed++; > return;
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 75517667b54f..133b31f44945 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -100,6 +100,12 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip, return; } + /* + * This user handler is shared with other kprobes and is not expected to be + * called recursively. So if any other kprobe handler is running, this will + * exit as kprobe does. See the section 'Share the callbacks with kprobes' + * in Documentation/trace/fprobe.rst for more information. + */ if (unlikely(kprobe_running())) { fp->nmissed++; return;