[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241016062359.264929-10-namhyung@kernel.org>
Date: Tue, 15 Oct 2024 23:23:59 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Kan Liang <kan.liang@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org,
Ravi Bangoria <ravi.bangoria@....com>,
Mark Rutland <mark.rutland@....com>,
James Clark <james.clark@....com>,
Kajol Jain <kjain@...ux.ibm.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Atish Patra <atishp@...shpatra.org>,
Palmer Dabbelt <palmer@...osinc.com>,
Mingwei Zhang <mizhang@...gle.com>
Subject: [PATCH v5 9/9] perf test: Add precise_max subtest to the perf record shell test
It's a very simply test just to run with cycles:P and instructions:P
events.
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/tests/shell/record.sh | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 8d6366d96883edb3..b23e83a099f84a65 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -271,6 +271,30 @@ test_topdown_leader_sampling() {
echo "Topdown leader sampling test [Success]"
}
+test_precise_max() {
+ echo "precise_max attribute test"
+ if ! perf stat -e "cycles,instructions" true 2> /dev/null
+ then
+ echo "precise_max attribute [Skipped no hardware events]"
+ return
+ fi
+ # Just to make sure it doesn't fail
+ if ! perf record -o "${perfdata}" -e "cycles:P" true 2> /dev/null
+ then
+ echo "precise_max attribute [Failed cycles:P event]"
+ err=1
+ return
+ fi
+ # On AMD, cycles and instructions events are treated differently
+ if ! perf record -o "${perfdata}" -e "instructions:P" true 2> /dev/null
+ then
+ echo "precise_max attribute [Failed instructions:P event]"
+ err=1
+ return
+ fi
+ echo "precise_max attribute test [Success]"
+}
+
# raise the limit of file descriptors to minimum
if [[ $default_fd_limit -lt $min_fd_limit ]]; then
ulimit -Sn $min_fd_limit
@@ -284,6 +308,7 @@ test_branch_counter
test_cgroup
test_leader_sampling
test_topdown_leader_sampling
+test_precise_max
# restore the default value
ulimit -Sn $default_fd_limit
--
2.47.0.rc1.288.g06298d1525-goog
Powered by blists - more mailing lists