Skip to contentSkip to conversation

selftests/acct: add cleanup for leftover process_log binary

PATCH Superseded Madhur Kumar 2 participants 9 messages Sep 22, 2025 – Sep 27, 2025 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 selftests/acct: add cleanup for leftover process_log binary

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove process_log during make kselftest-clean.

---
 tools/testing/selftests/acct/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/acct/Makefile +2 -1
index 7e025099cf65..16eb97079e63 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TEST_GEN_PROGS := acct_syscall
 CFLAGS += -Wall
+EXTRA_CLEAN := process_log
 
-include ../lib.mk
\ No newline at end of file
+include ../lib.mk
Signature · 1 line
2.51.0
#1 lore raw

PATCH 2/2 selftests/cachestat: add cleanup for leftover tmpshmcstat binary

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove tmpshmcstat during make kselftest-clean.

---
 tools/testing/selftests/cachestat/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/cachestat/Makefile +1 -0
index 778b54ebb036..c48065d791a9 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TEST_GEN_PROGS := test_cachestat
+EXTRA_CLEAN := tmpshmcstat
 
 CFLAGS += $(KHDR_INCLUDES)
 CFLAGS += -Wall
Signature · 1 line
2.51.0
maintainer
#3 lore raw
In reply to Madhur Kumar
Quoted 14 lines · Madhur Kumar

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove process_log during make kselftest-clean.

---
  tools/testing/selftests/acct/Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/acct/Makefile +0 -0
index 7e025099cf65..16eb97079e63 100644

tools/testing/selftests/acct/Makefile line 6

Quoted 9 lines
tools/testing/selftests/acct/Makefile +2 -1
@@ -1,5 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
  TEST_GEN_PROGS := acct_syscall
  CFLAGS += -Wall
+EXTRA_CLEAN := process_log
 
-include ../lib.mk
\ No newline at end of file
 
+include ../lib.mk

Why is this deleted and added back

Please fix the patch and send v2.

thanks,
-- Shuah

#5 lore raw

PATCH v2 1/2 selftests/acct: add cleanup for leftover process_log binary

In reply to Shuah Khan

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove process_log during make kselftest-clean.

v2:
- Fix newline issue at end of Makefile (caused add/delete in git diff)
- Code otherwise unchanged

---
 tools/testing/selftests/acct/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/acct/Makefile +1 -0
index 7e025099cf65..fd14128bbddb 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TEST_GEN_PROGS := acct_syscall
 CFLAGS += -Wall
+EXTRA_CLEAN := process_log
 
 include ../lib.mk
\ No newline at end of file
Signature · 1 line
2.51.0
maintainer
#6 lore raw
Quoted 4 lines · Madhur Kumar

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove process_log during make kselftest-clean.

This information below doesn't belong in the change log

Quoted 6 lines

v2:
- Fix newline issue at end of Makefile (caused add/delete in git diff)
- Code otherwise unchanged

---

Add patch version information here.

Quoted 8 lines
  tools/testing/selftests/acct/Makefile | 1 +
  1 file changed, 1 insertion(+)
tools/testing/selftests/acct/Makefile +0 -0
index 7e025099cf65..fd14128bbddb 100644

tools/testing/selftests/acct/Makefile line 6

Quoted 6 lines
tools/testing/selftests/acct/Makefile +1 -0
@@ -1,5 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
  TEST_GEN_PROGS := acct_syscall
  CFLAGS += -Wall
+EXTRA_CLEAN := process_log
 
  include ../lib.mk

This line below is still odd.

Quoted 1 line

\ No newline at end of file

Start without any changes, make the change, commit, and send v3. Refer to a few patches on the mailing list for examples on where the patch version information should be added.

thanks,
-- Shuah

maintainer
#2 lore raw

Re: [PATCH 2/2] selftests/cachestat: add cleanup for leftover tmpshmcstat binary

In reply to Madhur Kumar
Quoted 3 lines · Madhur Kumar

Some kselftests generate temporary binaries that are not tracked by TEST_GEN_PROGS. Add EXTRA_CLEAN entry to remove tmpshmcstat during make kselftest-clean.

This isn't really accurate. tmpshmcstat is generated when when test runs. Include this information in the change log and send new version of this patch.

Quoted 11 lines
---
  tools/testing/selftests/cachestat/Makefile | 1 +
  1 file changed, 1 insertion(+)
tools/testing/selftests/cachestat/Makefile +0 -0
index 778b54ebb036..c48065d791a9 100644

tools/testing/selftests/cachestat/Makefile line 6

Quoted 6 lines
tools/testing/selftests/cachestat/Makefile +1 -0
@@ -1,5 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
  TEST_GEN_PROGS := test_cachestat
+EXTRA_CLEAN := tmpshmcstat
 
  CFLAGS += $(KHDR_INCLUDES)
  CFLAGS += -Wall

thanks,
-- Shuah

#7 lore raw

PATCH v3 1/2 selftests/acct: add cleanup for leftover process_log binary

In reply to Madhur Kumar

The acct_syscall test generates a process_log binary after it runs, but this file is not removed by 'make kselftest-clean'. Add an EXTRA_CLEAN entry to ensure the binary gets cleaned up properly.

---

v3:
- refined changed log wording
- Removed patch version info from commit log (kept only problem/fix).

v2:
- Fix newline issue at end of Makefile (caused add/delete in git diff)
- Code otherwise unchanged

---
 tools/testing/selftests/acct/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/acct/Makefile +1 -0
index 7e025099cf65..fd14128bbddb 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TEST_GEN_PROGS := acct_syscall
 CFLAGS += -Wall
+EXTRA_CLEAN := process_log
 
 include ../lib.mk
\ No newline at end of file
Signature · 1 line
2.51.0
#8 lore raw

PATCH v2 2/2 selftests/cachestat: add cleanup for leftover tmpshmcstat file

In reply to Madhur Kumar

The cachestat test generates a temporary file named "tmpshmcstat" when it runs, but this file is not removed by 'make kselftest-clean'. Add an EXTRA_CLEAN entry to ensure the file gets cleaned up properly.

---

v2:
- Corrected subject line to describe "tmpshmcstat" as a file, not a binary.
- Refined commit log for clarity

---
 tools/testing/selftests/cachestat/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/cachestat/Makefile +1 -0
index 778b54ebb036..c48065d791a9 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 TEST_GEN_PROGS := test_cachestat
+EXTRA_CLEAN := tmpshmcstat
 
 CFLAGS += $(KHDR_INCLUDES)
 CFLAGS += -Wall
Signature · 1 line
2.51.0