From: Changbin Du <changbin.du@huawei.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: 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>,
Adrian Hunter <adrian.hunter@intel.com>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Hui Wang <hw.huiwang@huawei.com>,
Changbin Du <changbin.du@huawei.com>
Subject: [PATCH v3 3/3] perf: replace taskset with --workload-attr option
Date: Tue, 18 Jul 2023 11:33:55 +0800 [thread overview]
Message-ID: <20230718033355.2960912-4-changbin.du@huawei.com> (raw)
In-Reply-To: <20230718033355.2960912-1-changbin.du@huawei.com>
Replace the taskset with our new option --workload-attr.
Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
tools/perf/Documentation/intel-hybrid.txt | 2 +-
tools/perf/Documentation/perf-stat.txt | 2 +-
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh | 2 +-
tools/perf/tests/shell/test_arm_coresight.sh | 2 +-
tools/perf/tests/shell/test_data_symbol.sh | 2 +-
tools/perf/tests/shell/test_intel_pt.sh | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/Documentation/intel-hybrid.txt b/tools/perf/Documentation/intel-hybrid.txt
index e7a776ad25d7..b4adb1eeba3f 100644
--- a/tools/perf/Documentation/intel-hybrid.txt
+++ b/tools/perf/Documentation/intel-hybrid.txt
@@ -132,7 +132,7 @@ displayed. The percentage is the event's running time/enabling time.
One example, 'triad_loop' runs on cpu16 (atom core), while we can see the
scaled value for core cycles is 160,444,092 and the percentage is 0.47%.
-perf stat -e cycles \-- taskset -c 16 ./triad_loop
+perf stat -e cycles --workload-attr other,0,16 \-- ./triad_loop
As previous, two events are created.
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index 18d0f73458b1..fb52ddcea622 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -464,7 +464,7 @@ on workload with changing phases.
To interpret the results it is usually needed to know on which
CPUs the workload runs on. If needed the CPUs can be forced using
-taskset.
+--workload-attr option.
--td-level::
Print the top-down statistics that equal the input level. It allows
diff --git a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
index d724855d097c..b13bf391b137 100755
--- a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
@@ -64,7 +64,7 @@ check_cpu_list_counted()
{
local output
- output=$(perf stat -C 1 --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, taskset -c 1 sleep 1 2>&1)
+ output=$(perf stat -C 1 --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, --workload-attr other,0,1 -- sleep 1 2>&1)
if echo ${output} | grep -q -F "<not "; then
echo "Some CPU events are not counted"
if [ "${verbose}" = "1" ]; then
diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh
index f1bf5621160f..e00d04570aa8 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -38,7 +38,7 @@ record_touch_file() {
echo "Recording trace (only user mode) with path: CPU$2 => $1"
rm -f $file
perf record -o ${perfdata} -e cs_etm/@$1/u --per-thread \
- -- taskset -c $2 touch $file > /dev/null 2>&1
+ --workload-attr other,0,$2 -- touch $file > /dev/null 2>&1
}
perf_script_branch_samples() {
diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/shell/test_data_symbol.sh
index 69bb6fe86c50..02c6a97e3d0f 100755
--- a/tools/perf/tests/shell/test_data_symbol.sh
+++ b/tools/perf/tests/shell/test_data_symbol.sh
@@ -50,7 +50,7 @@ echo "Recording workload..."
# specific CPU and test in per-CPU mode.
is_amd=$(grep -E -c 'vendor_id.*AuthenticAMD' /proc/cpuinfo)
if (($is_amd >= 1)); then
- perf mem record -o ${PERF_DATA} -C 0 -- taskset -c 0 $TEST_PROGRAM &
+ perf mem record -o ${PERF_DATA} -C 0 --workload-attr other,0,0 -- $TEST_PROGRAM &
else
perf mem record --all-user -o ${PERF_DATA} -- $TEST_PROGRAM &
fi
diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
index 3a8b9bffa022..0dc085c72593 100755
--- a/tools/perf/tests/shell/test_intel_pt.sh
+++ b/tools/perf/tests/shell/test_intel_pt.sh
@@ -110,7 +110,7 @@ test_system_wide_side_band()
can_cpu_wide 1 || return $?
# Record on CPU 0 a task running on CPU 1
- perf_record_no_decode -o "${perfdatafile}" -e intel_pt//u -C 0 -- taskset --cpu-list 1 uname
+ perf_record_no_decode -o "${perfdatafile}" -e intel_pt//u -C 0 --workload-attr other,0,1 -- uname
# Should get MMAP events from CPU 1 because they can be needed to decode
mmap_cnt=$(perf script -i "${perfdatafile}" --no-itrace --show-mmap-events -C 1 2>/dev/null | grep -c MMAP)
--
2.25.1
next prev parent reply other threads:[~2023-07-18 3:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 3:33 [PATCH v3 0/3] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask Changbin Du
2023-07-18 3:33 ` [PATCH v3 1/3] perf cpumap: Add __perf_cpu_map__new and perf_cpu_map__2_cpuset Changbin Du
2023-07-18 3:33 ` [PATCH v3 2/3] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask Changbin Du
2023-07-18 3:33 ` Changbin Du [this message]
2023-07-20 10:00 ` [PATCH v3 0/3] " Adrian Hunter
2023-07-24 4:02 ` Changbin Du
2023-07-24 5:44 ` Adrian Hunter
2023-07-24 9:34 ` Changbin Du
2023-07-24 17:51 ` Adrian Hunter
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=20230718033355.2960912-4-changbin.du@huawei.com \
--to=changbin.du@huawei.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=hw.huiwang@huawei.com \
--cc=irogers@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 \
/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).