From nobody Fri Feb 13 12:31:04 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3540EE81817 for ; Tue, 26 Sep 2023 04:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233628AbjIZEaY (ORCPT ); Tue, 26 Sep 2023 00:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233320AbjIZEaJ (ORCPT ); Tue, 26 Sep 2023 00:30:09 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E144F0; Mon, 25 Sep 2023 21:30:02 -0700 (PDT) Received: from kwepemd200002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RvmrM4cH4ztSwf; Tue, 26 Sep 2023 12:25:39 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd200002.china.huawei.com (7.221.188.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.23; Tue, 26 Sep 2023 12:29:59 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , , , , Changbin Du Subject: [PATCH v5 4/5] perf: replace taskset with --workload-config option Date: Tue, 26 Sep 2023 12:29:37 +0800 Message-ID: <20230926042938.509234-5-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230926042938.509234-1-changbin.du@huawei.com> References: <20230926042938.509234-1-changbin.du@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200002.china.huawei.com (7.221.188.186) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Replace the taskset with our new option --workload-config. Signed-off-by: Changbin Du --- 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/Documen= tation/intel-hybrid.txt index e7a776ad25d7..f2b9d623a656 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/e= nabling 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%. =20 -perf stat -e cycles \-- taskset -c 16 ./triad_loop +perf stat -e cycles --workload-config cpu-list=3D16 \-- ./triad_loop =20 As previous, two events are created. =20 diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentat= ion/perf-stat.txt index b2038f7e236a..fc22d72560e1 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt @@ -464,7 +464,7 @@ on workload with changing phases. =20 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-config option. =20 --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 e75d0780dc78..c8737cb32a63 100755 --- a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh +++ b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh @@ -60,7 +60,7 @@ check_system_wide_counted() =20 check_cpu_list_counted() { - check_cpu_list_counted_output=3D$(perf stat -C 0,1 --bpf-counters --for-e= ach-cgroup ${test_cgroups} -e cpu-clock -x, taskset -c 1 sleep 1 2>&1) + check_cpu_list_counted_output=3D$(perf stat -C 0,1 --bpf-counters --for-e= ach-cgroup ${test_cgroups} -e cpu-clock -x, --workload-config cpu-list=3D1 = -- sleep 1 2>&1) if echo ${check_cpu_list_counted_output} | grep -q -F " $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 cpu-list=3D$2 -- touch $file > /dev/null 2>&1 } =20 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..d2b58c78a18b 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=3D$(grep -E -c 'vendor_id.*AuthenticAMD' /proc/cpuinfo) if (($is_amd >=3D 1)); then - perf mem record -o ${PERF_DATA} -C 0 -- taskset -c 0 $TEST_PROGRAM & + perf mem record -o ${PERF_DATA} -C 0 --workload-config cpu-list=3D0 -- $T= EST_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/she= ll/test_intel_pt.sh index 3a8b9bffa022..46f53aece135 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 $? =20 # 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= -config cpu-list=3D1 -- uname =20 # Should get MMAP events from CPU 1 because they can be needed to decode mmap_cnt=3D$(perf script -i "${perfdatafile}" --no-itrace --show-mmap-eve= nts -C 1 2>/dev/null | grep -c MMAP) --=20 2.25.1