lkml.org 
[lkml]   [2023]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 4/4] perf test: add test case for --workload-attr option
Date
Ensure the sched attributes are applied to workload.

Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
tools/perf/tests/shell/stat.sh | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh
index 3f1e67795490..b2279f118a97 100755
--- a/tools/perf/tests/shell/stat.sh
+++ b/tools/perf/tests/shell/stat.sh
@@ -16,6 +16,24 @@ test_default_stat() {
echo "Basic stat command test [Success]"
}

+test_stat_workload_attr() {
+ echo "stat with --workload-attr test"
+ if ! perf stat --workload-attr other,10,1 -- bash -c 'taskset -pc $$' 2>&1 | grep -E -q "current affinity list: 1"
+ then
+ echo "stat with --workload-attr test [Failed]"
+ err=1
+ return
+ fi
+
+ if ! perf stat --workload-attr other,10,1 -- bash -c 'ps -o pid,cls,ni,cmd -p $$' 2>&1 | grep -E -q "TS\s+10"
+ then
+ echo "stat with --workload-attr test [Failed]"
+ err=1
+ return
+ fi
+ echo "stat with --workload-attr test [Success]"
+}
+
test_stat_record_report() {
echo "stat record and report test"
if ! perf stat record -o - true | perf stat report -i - 2>&1 | \
@@ -147,6 +165,7 @@ test_cputype() {
}

test_default_stat
+test_stat_workload_attr
test_stat_record_report
test_stat_record_script
test_stat_repeat_weak_groups
--
2.25.1
\
 
 \ /
  Last update: 2023-07-27 10:48    [W:0.025 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site