From: Ian Rogers <irogers@google.com>
To: Alexey Bayduraev <alexey.bayduraev@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>,
Riccardo Mancini <rickyman7@gmail.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>
Subject: [PATCH 3/3] perf test: Add basic perf record tests
Date: Mon, 11 Apr 2022 23:21:33 -0700 [thread overview]
Message-ID: <20220412062133.2546080-3-irogers@google.com> (raw)
In-Reply-To: <20220412062133.2546080-1-irogers@google.com>
Test the --per-thread flag.
Test Intel machine state capturing.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/shell/record.sh | 37 ++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100755 tools/perf/tests/shell/record.sh
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
new file mode 100755
index 000000000000..2c85e73a0af4
--- /dev/null
+++ b/tools/perf/tests/shell/record.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# perf record tests
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+err=0
+test_per_thread() {
+ echo "Basic --per-thread mode test"
+ perf record -o - --per-thread true | perf report -i - > /dev/null
+ echo "Basic --per-thread mode test [Success]"
+}
+
+test_register_capture() {
+ echo "Register capture test"
+ if ! perf list | egrep -q 'br_inst_retired.near_call'
+ then
+ echo "Register capture test [Skipped missing instruction]"
+ return
+ fi
+ if ! perf record --intr-regs=\? 2>&1 | egrep -q 'available registers: AX BX CX DX SI DI BP SP IP FLAGS CS SS R8 R9 R10 R11 R12 R13 R14 R15'
+ then
+ echo "Register capture test [Skipped missing registers]"
+ return
+ fi
+ if ! perf record -o - --intr-regs=di,r8,dx,cx -e cpu/br_inst_retired.near_call/p -c 1000 --per-thread true | perf script -F ip,sym,iregs -i - | egrep -q "DI:"
+ then
+ echo "Register capture test [Failed missing output]"
+ err=1
+ return
+ fi
+ echo "Register capture test [Success]"
+}
+
+test_per_thread
+test_register_capture
+exit $err
--
2.35.1.1178.g4f1659d476-goog
next prev parent reply other threads:[~2022-04-12 6:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 6:21 [PATCH 1/3] perf record: Fix per-thread option Ian Rogers
2022-04-12 6:21 ` [PATCH 2/3] perf cpumap: Switch to using perf_cpu_map API Ian Rogers
2022-04-12 6:21 ` Ian Rogers [this message]
2022-04-13 20:13 ` [PATCH 3/3] perf test: Add basic perf record tests Namhyung Kim
2022-04-13 1:42 ` [PATCH 1/3] perf record: Fix per-thread option Alexey Bayduraev
2022-04-14 1:31 ` 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=20220412062133.2546080-3-irogers@google.com \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.bayduraev@gmail.com \
--cc=alexey.v.bayduraev@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--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=rickyman7@gmail.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;
as well as URLs for NNTP newsgroup(s).