lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 26 Sep 2023 12:29:38 +0800
From:   Changbin Du <changbin.du@...wei.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
CC:     Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <changbin.du@...il.com>, Changbin Du <changbin.du@...wei.com>
Subject: [PATCH v5 5/5] perf test: add test case for --workload-config option

Ensure the sched attributes are applied to workload.

Signed-off-by: Changbin Du <changbin.du@...wei.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..7b320a25505a 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_config() {
+  echo "stat with --workload-config test"
+  if ! perf stat --workload-config cpu-list=1 -- bash -c 'taskset -pc $$' 2>&1 | grep -E -q "current affinity list: 1"
+  then
+    echo "stat with --workload-config test [Failed]"
+    err=1
+    return
+  fi
+
+  if ! perf stat --workload-config sched_policy=other,sched_prio=10 -- bash -c 'ps -o pid,cls,ni,cmd -p $$' 2>&1 | grep -E -q "TS\s+10"
+  then
+    echo "stat with --workload-config test [Failed]"
+    err=1
+    return
+  fi
+  echo "stat with --workload-config 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_config
 test_stat_record_report
 test_stat_record_script
 test_stat_repeat_weak_groups
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ