public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,  Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Kan Liang <kan.liang@linux.intel.com>,
	James Clark <james.clark@linaro.org>,
	 Athira Jajeev <atrajeev@linux.vnet.ibm.com>,
	 zhaimingbing <zhaimingbing@cmss.chinamobile.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	 Veronika Molnarova <vmolnaro@redhat.com>,
	Leo Yan <leo.yan@linux.dev>,  Howard Chu <howardchu95@gmail.com>,
	Ze Gao <zegao2021@gmail.com>,
	 Weilin Wang <weilin.wang@intel.com>,
	linux-kernel@vger.kernel.org,  linux-perf-users@vger.kernel.org
Subject: [PATCH v1 1/3] perf test: Add a shell wrapper for "Setup struct perf_event_attr"
Date: Tue,  1 Oct 2024 10:19:48 -0700	[thread overview]
Message-ID: <20241001171950.233723-2-irogers@google.com> (raw)
In-Reply-To: <20241001171950.233723-1-irogers@google.com>

The "Setup struct perf_event_attr" test in attr.c does a bunch of
directory finding to set up running a python test that in general is
more brittle than similar logic we have in shell tests. Add a shell
test that invokes and runs the tests in the python attr.py script.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/attr.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 tools/perf/tests/shell/attr.sh

diff --git a/tools/perf/tests/shell/attr.sh b/tools/perf/tests/shell/attr.sh
new file mode 100755
index 000000000000..e094f3baffb7
--- /dev/null
+++ b/tools/perf/tests/shell/attr.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Perf attribute expectations test
+# SPDX-License-Identifier: GPL-2.0
+
+err=0
+
+cleanup() {
+  trap - EXIT TERM INT
+}
+
+trap_cleanup() {
+  echo "Unexpected signal in ${FUNCNAME[1]}"
+  cleanup
+  exit 1
+}
+trap trap_cleanup EXIT TERM INT
+
+shelldir=$(dirname "$0")
+perf_path=$(which perf)
+python "${shelldir}"/../attr.py -d "${shelldir}"/../attr -v -p "$perf_path"
+cleanup
+exit $err
-- 
2.46.1.824.gd892dcdcdd-goog


  reply	other threads:[~2024-10-01 17:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 17:19 [PATCH v1 0/3] Make a "Setup struct perf_event_attr" a shell test Ian Rogers
2024-10-01 17:19 ` Ian Rogers [this message]
2024-10-01 17:19 ` [PATCH v1 2/3] perf test: Remove C test wrapper for attr.py Ian Rogers
2024-10-01 17:19 ` [PATCH v1 3/3] perf test: Move attr files into shell directory where they are used Ian Rogers
2024-10-08 18:55 ` [PATCH v1 0/3] Make a "Setup struct perf_event_attr" a shell test Ian Rogers
2024-10-09  5:38   ` Namhyung Kim
2024-10-09  5:59     ` Ian Rogers
2024-10-10  0:56       ` Namhyung Kim
2024-10-10 15:50 ` Namhyung Kim
2024-10-11  6:48   ` Namhyung Kim
2024-10-13  5:38     ` Athira Rajeev
2024-10-13  6:58       ` Athira Rajeev

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=20241001171950.233723-2-irogers@google.com \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=howardchu95@gmail.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tmricht@linux.ibm.com \
    --cc=vmolnaro@redhat.com \
    --cc=weilin.wang@intel.com \
    --cc=zegao2021@gmail.com \
    --cc=zhaimingbing@cmss.chinamobile.com \
    /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