mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] perf test: Fix errors when deleting data in perf record tests
@ 2026-09-23 21:52 Namhyung Kim
  2026-09-23 21:52 ` [PATCH 2/3] perf test: Fix record tests on Intel Broadwell Namhyung Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Namhyung Kim @ 2026-09-23 21:52 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Jiri Olsa, Adrian Hunter, James Clark,
	Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users

perf record with multithreads would create a data directory instead of a
file.  But the cleanup and retry logic expect a file and try to delete
them with 'rm -f' which would fail.  Add '-r' flag to remove directories.

  rm: cannot remove '/tmp/__perf_test.perf.data.ZVHTw.old': Is a directory

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/shell/lib/perf_record.sh | 2 +-
 tools/perf/tests/shell/record.sh          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/shell/lib/perf_record.sh b/tools/perf/tests/shell/lib/perf_record.sh
index 2b9e11b66dc7a801..a95fafb8b6fa8b40 100644
--- a/tools/perf/tests/shell/lib/perf_record.sh
+++ b/tools/perf/tests/shell/lib/perf_record.sh
@@ -30,7 +30,7 @@ perf_record_with_retry() {
   fi
 
   for duration in 0.01 0.1 0.3 1.0 2.0; do
-    rm -f "${perfdata}".old
+    rm -rf "${perfdata}".old
     ${cmd_prefix} "$@" -o "${perfdata}" ${testprog_base} ${duration} > "$logfile" 2>&1
     local record_exit=$?
 
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 4a4931cb5ba91849..cf8ba3d3411b0bcc 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -39,8 +39,8 @@ default_fd_limit=$(ulimit -Sn)
 min_fd_limit=$(($(getconf _NPROCESSORS_ONLN) * 16))
 
 cleanup() {
-  rm -f "${perfdata}"
-  rm -f "${perfdata}".old
+  rm -rf "${perfdata}"
+  rm -rf "${perfdata}".old
   rm -f "${script_output}"
   perf_record_cleanup
 
-- 
2.56.0.rc1.310.g51773c2048-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-24  6:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 21:52 [PATCH 1/3] perf test: Fix errors when deleting data in perf record tests Namhyung Kim
2026-09-23 21:52 ` [PATCH 2/3] perf test: Fix record tests on Intel Broadwell Namhyung Kim
2026-09-24  3:45   ` Ian Rogers
2026-09-24  6:55     ` Mi, Dapeng
2026-09-23 21:52 ` [PATCH 3/3] perf test: Fix record tests on hybrid machines Namhyung Kim
2026-09-24  3:44   ` Ian Rogers
2026-09-24  3:39 ` [PATCH 1/3] perf test: Fix errors when deleting data in perf record tests Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®