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: 13439361 X-Patchwork-Delegate: mhiramat@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54DE07F5; Sat, 28 Oct 2023 03:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uLYxybp8" 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 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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