From nobody Fri Feb 13 12:31:03 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 F0E01CE79A6 for ; Tue, 26 Sep 2023 04:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233654AbjIZEad (ORCPT ); Tue, 26 Sep 2023 00:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233467AbjIZEaJ (ORCPT ); Tue, 26 Sep 2023 00:30:09 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43CD2F3; Mon, 25 Sep 2023 21:30:03 -0700 (PDT) Received: from kwepemd200002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rvms01H0QzNnp8; Tue, 26 Sep 2023 12:26:12 +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:30:00 +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 5/5] perf test: add test case for --workload-config option Date: Tue, 26 Sep 2023 12:29:38 +0800 Message-ID: <20230926042938.509234-6-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" Ensure the sched attributes are applied to workload. Signed-off-by: Changbin Du --- 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]" } =20 +test_stat_workload_config() { + echo "stat with --workload-config test" + if ! perf stat --workload-config cpu-list=3D1 -- bash -c 'taskset -pc $$= ' 2>&1 | grep -E -q "current affinity list: 1" + then + echo "stat with --workload-config test [Failed]" + err=3D1 + return + fi + + if ! perf stat --workload-config sched_policy=3Dother,sched_prio=3D10 --= 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=3D1 + 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() { } =20 test_default_stat +test_stat_workload_config test_stat_record_report test_stat_record_script test_stat_repeat_weak_groups --=20 2.25.1