From: linuxtestproject.agent@gmail.com
To: lufei <lufei@uniontech.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] Rewrite ftrace_regression tests with new C API
Date: Tue, 28 Apr 2026 09:30:24 +0000 [thread overview]
Message-ID: <20260428093024.3971-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260428075054.105295-1-lufei@uniontech.com>
Hi lufei,
On Tue, 28 Apr 2026, lufei wrote:
> Rewrite ftrace_regression tests with new C API
>
> Rewritten from old shell scripts.
Please explain why the conversion is being done — "Rewritten from old
shell scripts" only states what, not why. Also, this bundles two
independent test rewrites; please split into one commit per test.
> +static void run(void)
> +{
> + int i;
> +
> + for (i = 0; i < LOOP; i++) {
> + SAFE_FILE_PRINTF(STACK_TRACER_PATH, "1");
> + SAFE_FILE_PRINTF(TRACE_OPTIONS, "userstacktrace");
trace_options is modified but never saved/restored. The original
ftrace_lib.sh saved old_trace_options and restored it in
restore_old_setting(). Add TRACE_OPTIONS to .save_restore.
> + SAFE_FILE_PRINTF(page_fault_path, "%d", page_fault_origin);
This restore only runs on the normal path. If run() aborts via
tst_brk() inside the loop the enable flag is left set. Use .save_restore
or a dedicated cleanup() instead.
[...]
> +static void run(void)
> +{
> + int i;
> + const char *const cmd_ls[] = {"ls", "-l", "/sys/kernel/tracing/", NULL};
/sys/kernel/tracing/ is not guaranteed to exist on all configs. The
original used /proc; keep that or add an access() check with TCONF.
> + SAFE_FILE_PRINTF(SET_EVENT, "signal:signal_generate");
> + SAFE_FILE_PRINTF(TRACING_ON, "1");
Neither SET_EVENT nor TRACING_ON is restored. Add both to .save_restore.
---
Pre-existing issues noticed in the surrounding code (not introduced
by this patch):
- ftrace_lib.sh:109 — typo "function_pofile_enabled" (should be
"function_profile_enabled") prevents restoring profile state
---
Note:
Our agent completed the review of the patch. The agent can sometimes
produce false positives although often its findings are genuine. If
you find issues with the review, please comment this email or ignore
the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-04-28 9:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 8:05 [LTP] [PATCH 1/2] Rewrite ftrace_regression01.sh with new C API lufei
2026-03-04 8:05 ` [LTP] [PATCH 2/2] Rewrite ftrace_regression02.sh " lufei
2026-03-27 10:34 ` [LTP] [PATCH 1/2] Rewrite ftrace_regression01.sh " Andrea Cervesato via ltp
2026-03-30 7:15 ` [LTP] [PATCH v2] Rewrite ftrace_regression tests " lufei
2026-03-30 8:39 ` Andrea Cervesato via ltp
2026-03-31 1:55 ` [LTP] [PATCH v3] " lufei
2026-03-31 7:53 ` Petr Vorel
2026-03-31 7:56 ` Petr Vorel
2026-03-31 18:28 ` Cyril Hrubis
2026-03-31 10:01 ` [LTP] [PATCH v4] " lufei
2026-04-24 2:08 ` [LTP] [PATCH v5] " lufei
2026-04-24 2:42 ` [LTP] " linuxtestproject.agent
2026-04-27 8:40 ` [LTP] [PATCH v5] " Li Wang
2026-04-28 7:33 ` Cyril Hrubis
2026-04-28 7:50 ` [LTP] [PATCH v6] " lufei
2026-04-28 9:30 ` linuxtestproject.agent [this message]
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=20260428093024.3971-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=lufei@uniontech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox