From patchwork Sat Oct 28 03:34:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 13439358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AFE6C25B67 for ; Sat, 28 Oct 2023 03:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229507AbjJ1DeU (ORCPT ); Fri, 27 Oct 2023 23:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjJ1DeT (ORCPT ); Fri, 27 Oct 2023 23:34:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDC2106 for ; Fri, 27 Oct 2023 20:34:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BE39C433C7; Sat, 28 Oct 2023 03:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698464056; bh=GSCg8MotGa6UfxyDTlFmyiyhwNgWtF3ruxwlA0Hr0wQ=; h=From:To:Cc:Subject:Date:From; b=uLYxybp8qzfs3zZKcm40jtkuui2m6uv/ZU/cCNRwQnlpWRCDcr5YpdMycqRhhyGOO frv14rnFL8o5KvYRD6kKK0qeknBW8hxTo08XGgzUM+3x9fRafKz5bX3GLuujjEE+/A IuOZvbwtzk/98H237798PTm0kiYylLeThZS9wQ9isTUOO58yeuP6Z43oJVFVOQbOAY z6AqXaQMSYg+cpEV3oGtRGU+HGV8bTYZNwBa1xuB5KZv+hkJ4nmmlsNjP/xsjWr281 6JjeSbI3+ImF0m28cOhqu9m3iiN1amU29qtB/7pGtAhdeHdozClxB+hP5JnBn/ajxv l8RTfu4oGLapA== From: "Masami Hiramatsu (Google)" To: Steven Rostedt , Shuah Khan Cc: Andrii Nakryiko , linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, Francis Laniel , linux-kselftest@vger.kernel.org, Masami Hiramatsu Subject: [PATCH] selftests/ftrace: Add test case for a symbol in a module without module name Date: Sat, 28 Oct 2023 12:34:12 +0900 Message-Id: <169846405196.88147.17766692778800222203.stgit@devnote2> X-Mailer: git-send-email 2.34.1 User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Masami Hiramatsu (Google) Add a test case for probing on a symbol in a module without module name. When probing on a symbol in a module, ftrace accepts both the syntax that : and . Current test case only checks the former syntax. This adds a test for the latter one. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/kprobe/kprobe_module.tc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc index 7e74ee11edf9..4b32e1b9a8d3 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc @@ -13,6 +13,12 @@ fi MOD=trace_printk FUNC=trace_printk_irq_work +:;: "Add an event on a module function without module name" ;: + +echo "p:event0 $FUNC" > kprobe_events +test -d events/kprobes/event0 || exit_failure +echo "-:kprobes/event0" >> kprobe_events + :;: "Add an event on a module function without specifying event name" ;: echo "p $MOD:$FUNC" > kprobe_events