All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: James Clark <james.clark@arm.com>
Cc: acme@kernel.org, leo.yan@linaro.com,
	linux-perf-users@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] perf tests: Improve temp file cleanup in test_arm_coresight.sh
Date: Tue, 21 Sep 2021 23:10:10 -0700	[thread overview]
Message-ID: <CAP-5=fVF+LVFFHiBYfCesRmPiy7n2qZyTpMoH1eizQYMG9dPCw@mail.gmail.com> (raw)
In-Reply-To: <20210921131009.390810-3-james.clark@arm.com>

On Tue, Sep 21, 2021 at 6:10 AM James Clark <james.clark@arm.com> wrote:
>
> Cleanup perf.data.old files which are also dropped by perf, handle
> sigint and propagate it to the parent in case the test is run in a bash
> while loop and don't create the temp files if the test will be skipped.
>
> Signed-off-by: James Clark <james.clark@arm.com>


Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian


>
> ---
>  tools/perf/tests/shell/test_arm_coresight.sh | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh
> index c9eef0bba6f1..6de53b7ef5ff 100755
> --- a/tools/perf/tests/shell/test_arm_coresight.sh
> +++ b/tools/perf/tests/shell/test_arm_coresight.sh
> @@ -9,8 +9,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  # Leo Yan <leo.yan@linaro.org>, 2020
>
> -perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> -file=$(mktemp /tmp/temporary_file.XXXXX)
>  glb_err=0
>
>  skip_if_no_cs_etm_event() {
> @@ -22,13 +20,20 @@ skip_if_no_cs_etm_event() {
>
>  skip_if_no_cs_etm_event || exit 2
>
> +perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
> +file=$(mktemp /tmp/temporary_file.XXXXX)
> +
>  cleanup_files()
>  {
>         rm -f ${perfdata}
>         rm -f ${file}
> +       rm -f "${perfdata}.old"
> +       trap - exit term int
> +       kill -2 $$
> +       exit $glb_err
>  }
>
> -trap cleanup_files exit
> +trap cleanup_files exit term int
>
>  record_touch_file() {
>         echo "Recording trace (only user mode) with path: CPU$2 => $1"
> --
> 2.28.0
>

  reply	other threads:[~2021-09-22  6:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21 13:10 [PATCH 1/3] perf tests: Fix record+script_probe_vfs_getname.sh /tmp cleanup James Clark
2021-09-21 13:10 ` [PATCH 2/3] perf tests: Fix trace+probe_vfs_getname.sh " James Clark
2021-09-21 13:10 ` [PATCH 3/3] perf tests: Improve temp file cleanup in test_arm_coresight.sh James Clark
2021-09-22  6:10   ` Ian Rogers [this message]
2021-09-22 11:00   ` Leo Yan
2021-09-22 13:40     ` James Clark
2021-09-22 14:08       ` Leo Yan
2021-09-22 16:49         ` James Clark
2021-09-23  1:18           ` Leo Yan
     [not found] ` <CAP-5=fU_CSPv2Kry6ObbfYG4rNJpprhBrFUOJsNugM-AqQ3xoA@mail.gmail.com>
2021-10-26 14:18   ` [PATCH 1/3] perf tests: Fix record+script_probe_vfs_getname.sh /tmp cleanup Arnaldo Carvalho de Melo

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='CAP-5=fVF+LVFFHiBYfCesRmPiy7n2qZyTpMoH1eizQYMG9dPCw@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=namhyung@kernel.org \
    --subject='Re: [PATCH 3/3] perf tests: Improve temp file cleanup in test_arm_coresight.sh' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.