[GIT PULL] rv: Fixes for 7.3

Steven Rostedt posted 1 patch 1 month ago
tools/verification/rvgen/rvgen/kunit.py                                 | 2 +-
.../{test_bak_kunit_kunit.c.bak => test_bak_kunit_kunit.c.old}          | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename tools/verification/rvgen/tests/golden/test_bak_kunit/{test_bak_kunit_kunit.c.bak => test_bak_kunit_kunit.c.old} (100%)
[GIT PULL] rv: Fixes for 7.3
Posted by Steven Rostedt 1 month ago

Linus,

runtime verification fix for 7.3:

- Use .old instead of .bak for rvgen kunit backup files

  The rvgen kunit command generates .bak backup files and these are
  checked in for selftests as "golden" files for make check. Clean
  make disclean removes such files, leaving the tree dirty.
  Switch to .old to preserve a clean tree after make disclean.


Please pull the latest trace-rv-v7.3-2 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-rv-v7.3-2

Tag SHA1: 59b4def9b53efdd6c9e83f6a32aabf8b7001652a
Head SHA1: ab0304fd69b07605553e9f161d65ecf9ccc2e2fe


Gabriele Monaco (1):
      verification/rvgen: Use .old instead of .bak for kunit backup files

----
 tools/verification/rvgen/rvgen/kunit.py                                 | 2 +-
 .../{test_bak_kunit_kunit.c.bak => test_bak_kunit_kunit.c.old}          | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename tools/verification/rvgen/tests/golden/test_bak_kunit/{test_bak_kunit_kunit.c.bak => test_bak_kunit_kunit.c.old} (100%)
---------------------------
commit ab0304fd69b07605553e9f161d65ecf9ccc2e2fe
Author: Gabriele Monaco <gmonaco@redhat.com>
Date:   Mon Aug 24 10:15:19 2026 +0200

    verification/rvgen: Use .old instead of .bak for kunit backup files
    
    The rvgen kunit command generates .bak backup files and these can be
    checked in for selftests (make check). Clean targets like make disclean
    remove such files, leaving the tree dirty.
    
    Switch to .old to preserve a clean tree after make disclean.
    
    Reported-by: Kuan-Wei Chiu <visitorckw@gmail.com>
    Closes: https://lore.kernel.org/lkml/aosuwKH5GOEo0xTN@google.com
    Fixes: 7b6246294eb0 ("verification/rvgen: Add selftests for rvgen kunit")
    Reviewed-by: Nam Cao <namcao@linutronix.de>
    Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
    Link: https://lore.kernel.org/r/20260824081519.81103-2-gmonaco@redhat.com
    Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>

diff --git a/tools/verification/rvgen/rvgen/kunit.py b/tools/verification/rvgen/rvgen/kunit.py
index ed2082d7d3bc..85973f918c9b 100644
--- a/tools/verification/rvgen/rvgen/kunit.py
+++ b/tools/verification/rvgen/rvgen/kunit.py
@@ -173,7 +173,7 @@ EXPORT_SYMBOL_IF_KUNIT({struct_name});
             for path in (header_file_path, kunit_c_file_path):
                 if path.exists():
                     try:
-                        path.rename(path.with_suffix(path.suffix + ".bak"))
+                        path.rename(path.with_suffix(path.suffix + ".old"))
                     except OSError as e:
                         raise KUnitError(f"Error backing up file {path}: {e}") from e
 
diff --git a/tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.bak b/tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.old
similarity index 100%
rename from tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.bak
rename to tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.old
Re: [GIT PULL] rv: Fixes for 7.3
Posted by pr-tracker-bot@kernel.org 1 month ago
The pull request you sent on Wed, 26 Aug 2026 14:48:41 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-rv-v7.3-2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/b035a8be20ddfb932205beb9a1cbd80ea42e6cfb

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
Re: [GIT PULL] rv: Fixes for 7.3
Posted by Linus Torvalds 1 month ago
On Wed, 26 Aug 2026 at 11:48, Steven Rostedt <rostedt@goodmis.org> wrote:
>
>   The rvgen kunit command generates .bak backup files and these are
>   checked in for selftests as "golden" files for make check.

What?

What broken tool checks in generated files?

I've pulled this, but it sounds entirely insane to have checked in
that garbage file in

    tools/verification/rvgen/tests/golden/test_bak_kunit/test_bak_kunit_kunit.c.old

and you should stop doing that.

I'm very tempted to just do "git rm -rf
tools/verification/rvgen/tests/golden/" sicne these all seem to be
generated.

Having generated files around is *so* not what the kernel source tree is for.

Maybe the whole rvgen tree needs to be taken out of the kernel tree.

           Linus
Re: [GIT PULL] rv: Fixes for 7.3
Posted by Gabriele Monaco 1 month ago
On Wed, 2026-08-26 at 14:56 -0700, Linus Torvalds wrote:
> On Wed, 26 Aug 2026 at 11:48, Steven Rostedt <rostedt@goodmis.org> wrote:
> >   The rvgen kunit command generates .bak backup files and these are
> >   checked in for selftests as "golden" files for make check.
> 
> What?
> 
> What broken tool checks in generated files?


The standard usage of rvgen is to process a specification file (e.g. dot) and
generate code that is then /modified/ to be included in the kernel as working C
code. That's what you can see in kernel/trace/rv/monitors/ .

In this case, the golden directory is used only for rvgen's test suite, the
files needed to validate that the generation works, which has helped
tremendously during the past iterations of the tool.
This approach is similar to what is done in scripts/kconfig/tests/ with
*expected* files.

Thanks,
Gabriele