From: Gabriele Monaco <gmonaco@redhat.com>
To: wen.yang@linux.dev
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-trace-kernel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 9/9] selftests/verification: add tlob selftests
Date: Tue, 16 Jun 2026 16:58:05 +0200 [thread overview]
Message-ID: <dee3a6da35a41c9b0344ae610cc277e8488ae20c.camel@redhat.com> (raw)
In-Reply-To: <4aeb668c8446a9f6366d92e218df386bef7bc965.1780847473.git.wen.yang@linux.dev>
On Mon, 2026-06-08 at 00:13 +0800, wen.yang@linux.dev wrote:
> From: Wen Yang <wen.yang@linux.dev>
>
> Add selftest coverage for the tlob uprobe monitoring interface under
> tools/testing/selftests/verification/.
>
> test.d/tlob/ contains both the helper sources (tlob_target, tlob_sym)
> and the seven test scripts so the test suite is self-contained.
> tlob_target provides busy-spin, sleep, and preempt workloads;
> tlob_sym
> resolves ELF symbol offsets for uprobe registration.
>
> Seven test scripts exercise uprobe binding management, budget
> violation
> detection, and per-state time accounting (running_ns, waiting_ns,
> sleeping_ns).
>
> Signed-off-by: Wen Yang <wen.yang@linux.dev>
> ---
> .../testing/selftests/verification/.gitignore | 2 +
> tools/testing/selftests/verification/Makefile | 19 +-
> .../verification/test.d/tlob/Makefile | 20 ++
> .../verification/test.d/tlob/test.d/functions | 1 +
Tests seems to work fine, thanks. I think I'm getting what you're
trying to do and probably defining a dummy functions for tlob isn't the
right thing to do.
ftracetest --rv doesn't quite work with different folders as you'd pick
the ftrace functions. We shouldn't be adding a dummy functions script
every time but rather fix ftracetest directly.
Try the attached patch, it seems to work on my side. Then you'd be able
to use ftracetest --rv as you please (folder is mandatory, I don't
think we need a version inside selftests/verification,
verificationtest-ktap is only meant for the makefile just like
ftracetest-ktap).
Thanks,
Gabriele
---
From 32242f83af8214a51c47167a1904d3663aa43870 Mon Sep 17 00:00:00 2001
From: Gabriele Monaco <gmonaco@redhat.com>
Date: Tue, 16 Jun 2026 16:26:53 +0200
Subject: [PATCH] selftests/tracing: support flexible helper functions
Target directory or file arguments passed to ftracetest had
to contain their own nested test.d/functions files to properly override
the top-level directory (TOP_DIR). This works for standard ftrace tests
that would fall back to ftrace's functions, but doesn't for rv tests.
Introduce find_functions() to recursively check parent and grandparent
directories of the target test directory/file to dynamically locate the
appropriate root functions config.
This allows to define additional directories for rv selftests and run
them with the appropriate rv functions:
ftracetest --rv tools/testing/selftests/verification/test.d/<topic>
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
---
tools/testing/selftests/ftrace/ftracetest | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 0a56bf209f..5d1b1f9380 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -80,6 +80,23 @@ find_testcases() { #directory
echo `find $1 -name \*.tc | sort`
}
+find_functions() { # [directory] [test_cases]
+ local BASE_DIR="$1"
+ if [ -f "$1" ]; then
+ BASE_DIR="`absdir $1`"
+ elif [ ! -d "$1" ]; then
+ return
+ fi
+
+ if [ -f "$BASE_DIR"/test.d/functions ]; then
+ echo "$BASE_DIR"
+ elif [ -f "$BASE_DIR"/../test.d/functions ]; then
+ abspath "$BASE_DIR"/..
+ elif [ -f "$BASE_DIR"/../../test.d/functions ]; then
+ abspath "$BASE_DIR"/../..
+ fi
+}
+
parse_opts() { # opts
local OPT_TEST_CASES=
local OPT_TEST_DIR=
@@ -159,7 +176,8 @@ parse_opts() { # opts
if [ -n "$OPT_TEST_CASES" ]; then
TEST_CASES=$OPT_TEST_CASES
fi
- if [ -n "$OPT_TEST_DIR" -a -f "$OPT_TEST_DIR"/test.d/functions ]; then
+ OPT_TEST_DIR="`find_functions $OPT_TEST_DIR $OPT_TEST_CASES`"
+ if [ -n "$OPT_TEST_DIR" ]; then
TOP_DIR=$OPT_TEST_DIR
TEST_DIR=$TOP_DIR/test.d
fi
--
2.54.0
next prev parent reply other threads:[~2026-06-16 14:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-07 16:13 [PATCH v3 0/9] rv/tlob: Add task latency over budget RV monitor wen.yang
2026-06-07 16:13 ` [PATCH v3 1/9] rv/da: introduce DA_MON_ALLOCATION_STRATEGY wen.yang
2026-06-15 9:56 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 2/9] rv: add generic uprobe infrastructure for RV monitors wen.yang
2026-06-16 9:49 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 3/9] rv/tlob: add tlob model DOT file wen.yang
2026-06-07 16:13 ` [PATCH v3 4/9] rv/ha: fix ha_invariant_passed_ns silent bypass of invariant check wen.yang
2026-06-15 10:12 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 5/9] rv/ha: make da_monitor_reset_hook and EVENT_NONE_LBL overridable wen.yang
2026-06-15 10:16 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 6/9] rv/tlob: add tlob hybrid automaton monitor wen.yang
2026-06-15 15:24 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 7/9] rv/tlob: add KUnit tests for the tlob monitor wen.yang
2026-06-07 16:13 ` [PATCH v3 8/9] selftests/verification: fix verificationtest-ktap for out-of-tree execution wen.yang
2026-06-16 11:14 ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 9/9] selftests/verification: add tlob selftests wen.yang
2026-06-16 14:58 ` Gabriele Monaco [this message]
2026-06-13 16:00 ` [PATCH v3 0/9] rv/tlob: Add task latency over budget RV monitor Wen Yang
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=dee3a6da35a41c9b0344ae610cc277e8488ae20c.camel@redhat.com \
--to=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=wen.yang@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox