Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2122075rwb; Thu, 27 Jul 2023 02:19:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5nnLr3sIxAtYtH3Ees/eJ0WkRBwge+iQlafl47XCWjlYC1HQplw8J6AsxJTpOQFe7jwPM X-Received: by 2002:a05:6358:898:b0:134:dc90:b7d1 with SMTP id m24-20020a056358089800b00134dc90b7d1mr2109106rwj.25.1690449574655; Thu, 27 Jul 2023 02:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690449574; cv=none; d=google.com; s=arc-20160816; b=Rg1twNBWl5HdBE/+zTyTTnMLDydMKFyuF/DmhVxI2lbgVhTSKa4RZdv7UTpaCeQnQg mT6I0Aj+g7uuRxFuEloJjk64y+hafhPGpl4/xcEDR65Lm7+DmotnbNpQEWmWgtdr455e hfV6K1uqFPsD7QncMr4UzEWD+qHGQhl33DF5BQHgblaAi8UTfaRNz3R+p3OokFh+z9JO gTmI3kK/8UjGPBM0khKy+kRL986+YRTOBgDDQhJdeqlWUF3a/FRvz09KxkAN8zsdgdO2 GwaUEJ5czSv5Rvhzv+torrb1EvjJg3aoqaM8p3hfqIL8oznpBXGjRmtyYMAvjx2hruNp idZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZdSWka75n6AHHN16zmq/6K9spymduaQMNA87WghEJoM=; fh=ApeLdK2xurAeWAFDrmxfomKJVPpeLi5+JFM/i5kBxGg=; b=n7O9nV7RrX5dZR0smOYa1iaKQkvnQVntVZRZhyZHu2m2S/w8uToottUubs1CkwAFk3 9WxW30wlQNssYEXW3+5zZjaVVQFuwbhbvq4FLeRAWDGtkPDylCJHH2I3Xgejs08gsn9B 10oZ4qUDoAqD6biOhwqFCPuce/yAnXIi+l8ZQpEIvGHeEpmRoilp9Rrlisbn/d6nyTNo PTVhe5/FxZA2xsN+EzlcKpWf+zGip/VxNRm/6HMxKIiUo11dSyCVMoBBDAvzSCK5hG9e VShN6cdLlJ7QEHZdhBURjgyiQ7s1dg7Ymc0jJYFKku8MPhm5w+MT9IpMNLUIc5Cib06t T44w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a635545000000b0056399efdbdcsi936698pgm.846.2023.07.27.02.19.22; Thu, 27 Jul 2023 02:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233726AbjG0Irh (ORCPT + 99 others); Thu, 27 Jul 2023 04:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232941AbjG0IrG (ORCPT ); Thu, 27 Jul 2023 04:47:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42EAE9A9F; Thu, 27 Jul 2023 01:29:44 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RBP404xWWztRdS; Thu, 27 Jul 2023 16:26:08 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 27 Jul 2023 16:29:22 +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 , , , Hui Wang , Changbin Du Subject: [PATCH v4 4/4] perf test: add test case for --workload-attr option Date: Thu, 27 Jul 2023 16:28:52 +0800 Message-ID: <20230727082852.916093-5-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230727082852.916093-1-changbin.du@huawei.com> References: <20230727082852.916093-1-changbin.du@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..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