From patchwork Sat Jan 7 13:32:17 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: 13092146 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 4E868C54EBD for ; Sat, 7 Jan 2023 13:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbjAGNcf (ORCPT ); Sat, 7 Jan 2023 08:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232135AbjAGNc0 (ORCPT ); Sat, 7 Jan 2023 08:32:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E6315E0A5; Sat, 7 Jan 2023 05:32:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5D962B810AA; Sat, 7 Jan 2023 13:32:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EC7AC433EF; Sat, 7 Jan 2023 13:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673098342; bh=HGJHlcKefwA/vKHzLOsju9wxMYeQUgD1tHvIeGZhwP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PNrzDEV/aOPxQaA9ne4EU1emyfiqMkOkcV/hymisgM67DzCy+jw+H10Yk0C2JmRYy aw1l9jmWeMlBEBn6wfTSI9E5WrJNaohNhPM+WMZDdDLXadkoWTfQyBXyUsmCwCsXZf rjrJS6uZ1PBqfXcDDfCY1AnsS4Kad4vhnags7NvDnmq3v5HBDsVmWU3ZmdysSDeT1X USleihtE+VMLLWG4yLVDSwuSCXsvqLAfe7+WNkaP/v/FMc+I9IezXffJ1Yi6DyWocZ E8/rGGNtzQ2LCwW8vxulw+ytnxPFFKOE9kEoZtZJQpKQC6pMYsQnA3sRWqKA+rHsPP FbMVepdiY9JcA== From: "Masami Hiramatsu (Google)" To: Shuah Khan , Steven Rostedt Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 1/3] tracing/eprobe: Fix to add filter on eprobe description in README file Date: Sat, 7 Jan 2023 22:32:17 +0900 Message-Id: <167309833728.640500.12232259238201433587.stgit@devnote3> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <167309832823.640500.13244630381161014364.stgit@devnote3> References: <167309832823.640500.13244630381161014364.stgit@devnote3> 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) Fix to add a description of the filter on eprobe in README file. This is required to identify the kernel supports the filter on eprobe or not. Fixes: 752be5c5c910 ("tracing/eprobe: Add eprobe filter support") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a555a861b978..d0c22766dc26 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5598,7 +5598,7 @@ static const char readme_msg[] = #ifdef CONFIG_HIST_TRIGGERS "\t s:[synthetic/] []\n" #endif - "\t e[:[/][]] . []\n" + "\t e[:[/][]] . [] [if ]\n" "\t -:[/][]\n" #ifdef CONFIG_KPROBE_EVENTS "\t place: [:][+]|\n" From patchwork Sat Jan 7 13:32:27 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: 13092147 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 294B2C54EBD for ; Sat, 7 Jan 2023 13:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbjAGNcq (ORCPT ); Sat, 7 Jan 2023 08:32:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjAGNcd (ORCPT ); Sat, 7 Jan 2023 08:32:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C98795D415; Sat, 7 Jan 2023 05:32:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 575A360C14; Sat, 7 Jan 2023 13:32:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B3D1C433D2; Sat, 7 Jan 2023 13:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673098350; bh=lA+rE8kKU4UerwopcQ1eDt8yxXIRd212goJdv8X2Ulo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kX2M9ZVPoclER5r+AYgjQNDSJPnG2X0VHHYExO94dzwNPeeIwexodLfSdEtSHz53T bRIVV77kkNHpyFAG0a3VQyfdq7TJ/tJZcYHCehITGUgcpAsHb/yFmG6hV+uyCHlG3W bGMNDuAVxWUt0bzV62ordUOSXhHNPsKi2fi6PEyThPykZUoVpV+CAolu2JAKwUcwzL cCBW3jih6ABBjXOxH4YtoU+S0iTZhLYXUwZUGGhWz7uEZ8Av0Wr7LTav/vja7VdFJM PSmtvrlnuouQVx5BrVyq1kH/3eOds0fy9dbhURyXv7uKocmtRLcUIZfA3j6Rh/9xKx K+U9yjfSNjhng== From: "Masami Hiramatsu (Google)" To: Shuah Khan , Steven Rostedt Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 2/3] selftests/ftrace: Fix eprobe syntax test case to check filter support Date: Sat, 7 Jan 2023 22:32:27 +0900 Message-Id: <167309834742.640500.379128668288448035.stgit@devnote3> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <167309832823.640500.13244630381161014364.stgit@devnote3> References: <167309832823.640500.13244630381161014364.stgit@devnote3> 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) Fix eprobe syntax test case to check whether the kernel supports the filter on eprobe for filter syntax test command. Without this fix, this test case will fail if the kernel supports eprobe but doesn't support the filter on eprobe. Fixes: 9e14bae7d049 ("selftests/ftrace: Add eprobe syntax error testcase") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) --- .../test.d/dynevent/eprobes_syntax_errors.tc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc index fc1daac7f066..4f5e8c665156 100644 --- a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc +++ b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc @@ -22,6 +22,8 @@ check_error 'e:foo/^bar.1 syscalls/sys_enter_openat' # BAD_EVENT_NAME check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd' # BAD_FETCH_ARG check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo' # BAD_ATTACH_ARG -check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER +if grep -q '\..*\[if \]' README; then + check_error 'e:foo/bar syscalls/sys_enter_openat if ^' # NO_EP_FILTER +fi exit 0 From patchwork Sat Jan 7 13:32:36 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: 13092148 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 26CCFC46467 for ; Sat, 7 Jan 2023 13:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232619AbjAGNdI (ORCPT ); Sat, 7 Jan 2023 08:33:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232342AbjAGNcl (ORCPT ); Sat, 7 Jan 2023 08:32:41 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1305E0B7; Sat, 7 Jan 2023 05:32:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B1E960C08; Sat, 7 Jan 2023 13:32:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B7D7C433EF; Sat, 7 Jan 2023 13:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673098360; bh=QQjmgf5W/T/Kzs3A2mqRoW9fGZAadyb1nwhZ/JNs3Uo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5v0ZpD7GrnovovNTeycO7D8G9AusoUDyOmMLdWFRQXW2hGZat6+XCcMYZlvUIkcr 3Si5qSbWy8UEMjnx2xg7tuPr4jsi2uaBf67bpkW0xmc+kGAUUDNVQ7xpGCayNWXlFj 7fV2ib8aRBgK1Ke1cZZFM0N8y1sMS89yuTJKvRZMMCbMynFiAuZjCi4vjoEPyRP0lI pkwq2Jpme+73ahSaxONYJ7Wbi9aRRhYrCgshZxV/39CTOqBQ+9ZivZ3yzD7hWqI5Vc mKR908XXakWA0rznLWnDbW+DrZ0nghg7Wr6JPBqAyRmn5+OZxVKFByLJkaryo9D/DC vGOoyXIfw6NCQ== From: "Masami Hiramatsu (Google)" To: Shuah Khan , Steven Rostedt Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 3/3] selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols Date: Sat, 7 Jan 2023 22:32:36 +0900 Message-Id: <167309835609.640500.9664678940260305746.stgit@devnote3> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <167309832823.640500.13244630381161014364.stgit@devnote3> References: <167309832823.640500.13244630381161014364.stgit@devnote3> 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) Fix kprobe probepoint testcase to ignore __pfx_* prefix symbols. Those are introduced by commit b341b20d648b ("x86: Add prefix symbols for function padding") for identifying PADDING_BYTES of NOPs. Since kprobe events can not probe these prefix symbols, this testcase has to skip those symbols. Fixes: b341b20d648b ("x86: Add prefix symbols for function padding") Signed-off-by: Masami Hiramatsu (Google) --- .../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc index 624269c8d534..68425987a5dd 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc @@ -21,7 +21,7 @@ set_offs() { # prev target next # We have to decode symbol addresses to get correct offsets. # If the offset is not an instruction boundary, it cause -EILSEQ. -set_offs `grep -A1 -B1 ${TARGET_FUNC} /proc/kallsyms | cut -f 1 -d " " | xargs` +set_offs `grep -v __pfx_ /proc/kallsyms | grep -A1 -B1 ${TARGET_FUNC} | cut -f 1 -d " " | xargs` UINT_TEST=no # printf "%x" -1 returns (unsigned long)-1.