mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: [PATCH 1/3] perf test: Fix errors when deleting data in perf record tests
Date: Wed, 23 Sep 2026 14:52:53 -0700	[thread overview]
Message-ID: <20260923215255.3329181-1-namhyung@kernel.org> (raw)

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


             reply	other threads:[~2026-09-23 21:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 21:52 Namhyung Kim [this message]
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

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=20260923215255.3329181-1-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®