mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-24 10:49:54 +02:00
c6b1f57075
Add basic test for 'perf sched stats {record|report|diff}' subcommand.
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Anubhav Shelat <ashelat@redhat.com>
Cc: Ben Gainey <ben.gainey@arm.com>
Cc: Blake Jones <blakejones@google.com>
Cc: Chun-Tse Shao <ctshao@google.com>
Cc: David Vernet <void@manifault.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Gautham Shenoy <gautham.shenoy@amd.com>
Cc: Graham Woodward <graham.woodward@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Yang Jihong <yangjihong@bytedance.com>
Cc: Yujie Liu <yujie.liu@intel.com>
Cc: Zhongqiu Han <quic_zhonhan@quicinc.com>
Link: https://lore.kernel.org/r/20260119175833.340369-10-swapnil.sapkal@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
65 lines
1.6 KiB
Bash
Executable File
65 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
# perf sched stats tests
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
set -e
|
|
|
|
err=0
|
|
test_perf_sched_stats_record() {
|
|
echo "Basic perf sched stats record test"
|
|
if ! perf sched stats record true 2>&1 | \
|
|
grep -E -q "[ perf sched stats: Wrote samples to perf.data ]"
|
|
then
|
|
echo "Basic perf sched stats record test [Failed]"
|
|
err=1
|
|
return
|
|
fi
|
|
echo "Basic perf sched stats record test [Success]"
|
|
}
|
|
|
|
test_perf_sched_stats_report() {
|
|
echo "Basic perf sched stats report test"
|
|
perf sched stats record true > /dev/null
|
|
if ! perf sched stats report 2>&1 | grep -E -q "Description"
|
|
then
|
|
echo "Basic perf sched stats report test [Failed]"
|
|
err=1
|
|
rm perf.data
|
|
return
|
|
fi
|
|
rm perf.data
|
|
echo "Basic perf sched stats report test [Success]"
|
|
}
|
|
|
|
test_perf_sched_stats_live() {
|
|
echo "Basic perf sched stats live mode test"
|
|
if ! perf sched stats true 2>&1 | grep -E -q "Description"
|
|
then
|
|
echo "Basic perf sched stats live mode test [Failed]"
|
|
err=1
|
|
return
|
|
fi
|
|
echo "Basic perf sched stats live mode test [Success]"
|
|
}
|
|
|
|
test_perf_sched_stats_diff() {
|
|
echo "Basic perf sched stats diff test"
|
|
perf sched stats record true > /dev/null
|
|
perf sched stats record true > /dev/null
|
|
if ! perf sched stats diff > /dev/null
|
|
then
|
|
echo "Basic perf sched stats diff test [Failed]"
|
|
err=1
|
|
rm perf.data.old perf.data
|
|
return
|
|
fi
|
|
rm perf.data.old perf.data
|
|
echo "Basic perf sched stats diff test [Success]"
|
|
}
|
|
|
|
test_perf_sched_stats_record
|
|
test_perf_sched_stats_report
|
|
test_perf_sched_stats_live
|
|
test_perf_sched_stats_diff
|
|
exit $err
|