All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: live-patching@vger.kernel.org
Cc: joe.lawrence@redhat.com, jpoimboe@kernel.org,
	kernel-team@meta.com, song@kernel.org, jikos@kernel.org,
	mbenes@suse.cz, pmladek@suse.com
Subject: [PATCH v2] selftest/livepatch: Only run test-kprobe with CONFIG_KPROBES_ON_FTRACE
Date: Tue, 18 Mar 2025 11:15:18 -0700	[thread overview]
Message-ID: <20250318181518.1055532-1-song@kernel.org> (raw)

CONFIG_KPROBES_ON_FTRACE is required for test-kprobe. Skip test-kprobe
when CONFIG_KPROBES_ON_FTRACE is not set. Since some kernel may not have
/proc/config.gz, grep for kprobe_ftrace_ops from /proc/kallsyms to check
whether CONFIG_KPROBES_ON_FTRACE is enabled.

Signed-off-by: Song Liu <song@kernel.org>

---

Changes v1 => v2:
1. Grep for kprobe_ftrace_ops in /proc/kallsyms, as some systems may not
   have /proc/config.gz
---
 tools/testing/selftests/livepatch/test-kprobe.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/livepatch/test-kprobe.sh b/tools/testing/selftests/livepatch/test-kprobe.sh
index 115065156016..e514391c5454 100755
--- a/tools/testing/selftests/livepatch/test-kprobe.sh
+++ b/tools/testing/selftests/livepatch/test-kprobe.sh
@@ -5,6 +5,8 @@
 
 . $(dirname $0)/functions.sh
 
+grep kprobe_ftrace_ops /proc/kallsyms || skip "test-kprobe requires CONFIG_KPROBES_ON_FTRACE"
+
 MOD_LIVEPATCH=test_klp_livepatch
 MOD_KPROBE=test_klp_kprobe
 
-- 
2.47.1


             reply	other threads:[~2025-03-18 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 18:15 Song Liu [this message]
2025-03-21 13:16 ` [PATCH v2] selftest/livepatch: Only run test-kprobe with CONFIG_KPROBES_ON_FTRACE Miroslav Benes
2025-03-24 17:57 ` Joe Lawrence
2025-03-25 12:46 ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250318181518.1055532-1-song@kernel.org \
    --to=song@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.