From: sashiko-bot@kernel.org
To: wen.yang@linux.dev
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v5 7/9] rv: Add KUnit tests for the tlob monitor
Date: Wed, 19 Aug 2026 18:24:50 +0000 [thread overview]
Message-ID: <20260819182450.DF8FD1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <31b0f05cbbb4859b510e247687e467bf2096b4f6.1787161646.git.wen.yang@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing prototype declaration warning (-Wmissing-prototypes) when CONFIG_KUNIT is enabled but CONFIG_TLOB_KUNIT_TEST is disabled.
--
--- Patch [7]: [PATCH v5 7/9] rv: Add KUnit tests for the tlob monitor ---
commit c187567361217a017982494c7c6e1a3021a25452
Author: Wen Yang <wen.yang@linux.dev>
rv: Add KUnit tests for the tlob monitor
This commit adds a KUnit test suite for the tlob monitor's uprobe-line
parsers. It modifies tlob_parse_uprobe_line and tlob_parse_remove_line
to be visible and exported when testing is enabled.
> diff --git a/kernel/trace/rv/monitors/tlob/tlob.c b/kernel/trace/rv/monitors/tlob/tlob.c
> index 99acd34726f10..e109390ba3ada 100644
> --- a/kernel/trace/rv/monitors/tlob/tlob.c
> +++ b/kernel/trace/rv/monitors/tlob/tlob.c
> @@ -874,7 +874,7 @@ static ssize_t tlob_monitor_read(struct file *file,
> * PATH may contain ':'; the last ':' separates path from offset.
> * Returns 0, -EINVAL, or -ERANGE.
> */
> -static int tlob_parse_uprobe_line(char *buf, u64 *thr_out,
> +VISIBLE_IF_KUNIT int tlob_parse_uprobe_line(char *buf, u64 *thr_out,
> char **path_out,
> loff_t *start_out, loff_t *stop_out)
[ ... ]
> diff --git a/kernel/trace/rv/monitors/tlob/tlob.h b/kernel/trace/rv/monitors/tlob/tlob.h
> index 94e7382c2130b..6ad9d5179ab60 100644
> --- a/kernel/trace/rv/monitors/tlob/tlob.h
> +++ b/kernel/trace/rv/monitors/tlob/tlob.h
> @@ -146,4 +146,10 @@ static const struct automaton_tlob automaton_tlob = {
> /* Upper budget bound (1 hour): keeps the u64 ns accumulators far from overflow. */
> #define TLOB_MAX_THRESHOLD_NS 3600000000000ULL
>
> +#if IS_ENABLED(CONFIG_TLOB_KUNIT_TEST)
> +int tlob_parse_uprobe_line(char *buf, u64 *thr_out, char **path_out,
> + loff_t *start_out, loff_t *stop_out);
> +int tlob_parse_remove_line(char *buf, char **path_out, loff_t *start_out);
> +#endif /* CONFIG_TLOB_KUNIT_TEST */
[Severity: Low]
Will this cause a missing-prototypes build warning when CONFIG_KUNIT is
enabled but CONFIG_TLOB_KUNIT_TEST is disabled?
In tlob.c, VISIBLE_IF_KUNIT drops the static keyword whenever CONFIG_KUNIT
is enabled, making the functions global.
However, the prototype declarations here in tlob.h are strictly gated
behind CONFIG_TLOB_KUNIT_TEST.
If a kernel is built with CONFIG_KUNIT=y but CONFIG_TLOB_KUNIT_TEST=n, the
functions become global without a visible prototype, which will trigger
-Wmissing-prototypes build errors. Should this IS_ENABLED() check use
CONFIG_KUNIT instead to match the visibility macro?
> +
> #endif /* _RV_TLOB_H */
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787161646.git.wen.yang@linux.dev?part=7
next prev parent reply other threads:[~2026-08-19 18:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 18:15 [PATCH v5 0/9] rv: Add task latency over budget RV monitor wen.yang
2026-08-19 18:15 ` [PATCH v5 1/9] rv: Introduce DA_MON_ALLOCATION_STRATEGY wen.yang
2026-08-19 18:30 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 2/9] rv: Add generic uprobe infrastructure for RV monitors wen.yang
2026-08-19 18:27 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 3/9] rv: Add tlob model DOT file wen.yang
2026-08-19 18:25 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 4/9] rv: Fix ha_invariant_passed_ns silent bypass of invariant check wen.yang
2026-08-19 18:32 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 5/9] rv: Make da_monitor_reset_hook and EVENT_NONE_LBL overridable wen.yang
2026-08-19 18:30 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 6/9] rv: Add tlob hybrid automaton monitor wen.yang
2026-08-19 18:34 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 7/9] rv: Add KUnit tests for the tlob monitor wen.yang
2026-08-19 18:24 ` sashiko-bot [this message]
2026-08-19 18:15 ` [PATCH v5 8/9] selftests/verification: Add tlob selftests wen.yang
2026-08-19 18:27 ` sashiko-bot
2026-08-19 18:15 ` [PATCH v5 9/9] selftests/ftrace: Walk up to find test.d/functions when a subdirectory is passed wen.yang
2026-08-19 18:31 ` sashiko-bot
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=20260819182450.DF8FD1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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