Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5490292rwp; Mon, 17 Jul 2023 05:12:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlH93CrWdR564vPw+rLO1qIrNIgA1sVDmcbRZq92lgCIo3J4TmeBHXSbbRgrk/xX5exPfftH X-Received: by 2002:a17:90a:6548:b0:259:3e2a:b6d8 with SMTP id f8-20020a17090a654800b002593e2ab6d8mr10732143pjs.17.1689595976403; Mon, 17 Jul 2023 05:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689595976; cv=none; d=google.com; s=arc-20160816; b=jBgS3Mym8VNBiYxJed1Oz0CfEFi4ynnl7c+7Zkl16PpNK5n9uUcupEXjEg2EYRBAar G56dkVcjWpn6EXbsyp6x7CXdmpCGdBbrTq/Eud0uEPiWK1099/0wS9a/54GPazu8nwtJ iPpxctoF/NAeXK6t2fBBluEjXxRbYdZbzkXY6JMDGYLmqtzpwMr91JQcB5wesKFpW4lB Ft5/1JS8//erpF/6uKBKUPk0stdrPg3MMnF3sUnCnupOoY5gVrrWmixx4r/CeFLjk2pt QrFc6n7h9UVe0TbPhBZRoz6eHMeL0roauyg6lDYTyQhQiCfTMJAD4VaoVtl9XHq/5wBP E4nA== 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 :message-id:date:subject:cc:to:from; bh=Uoq8rcRhD11ONqfF7vLEydefxT7XOdAUTDJqUqdG0uI=; fh=ApeLdK2xurAeWAFDrmxfomKJVPpeLi5+JFM/i5kBxGg=; b=yxsDULHCoKFKpfbP1O1YivmMvxoh6TkDJFl7way44ZD41vwvA+O5UTU0S6sEMJxgx/ H37BfoCGN6bn4HP9DaEBmrf0H07GmEW08RK9+vUJ/YL6OVj4892sKHjwf0mCwC8fYCRr mPVMqQW5zwB8LXMQm4qiW2ypWXa5q4iXw3ktOhZsOwFZnbFDCzwOZd1LNvYvXTItTVMd x0FWxQA8UvtNVhOVPs1J5AYOV7m1goWPo+e9i4Ang3ufVBnFeKk7LXudn/EZpGr30PZ4 bppRaZD9aUfkzLH3TElhKUd/IS8Q66hSDiqK+m5ftX51tVrIDHH5eCBsConcBFl6bZ/9 tUWw== 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 o19-20020a17090ac71300b0026349debbdfsi5740031pjt.136.2023.07.17.05.12.42; Mon, 17 Jul 2023 05:12:56 -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 S229619AbjGQMAw (ORCPT + 99 others); Mon, 17 Jul 2023 08:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjGQMAu (ORCPT ); Mon, 17 Jul 2023 08:00:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A71E58; Mon, 17 Jul 2023 05:00:30 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R4LD44jmMzNmRk; Mon, 17 Jul 2023 19:57: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; Mon, 17 Jul 2023 20:00:26 +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 v2 0/2] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask Date: Mon, 17 Jul 2023 20:00:01 +0800 Message-ID: <20230717120003.2391329-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 This adds a new option '--workload-attr' to set the sched_policy/priority/mask of the workload to reduce system noise. $ sudo perf stat --workload-attr fifo,40,0-3:7 -- ls Please see patch 1/2 for more details. v2: - Use cpu list spec instead of cpu mask number. - Update documents. Changbin Du (2): perf cpumap: Add __perf_cpu_map__new and perf_cpu_map__2_cpuset perf: add new option '--workload-attr' to set workload sched_policy/priority/mask tools/lib/perf/cpumap.c | 45 ++++++++- tools/lib/perf/include/perf/cpumap.h | 4 + tools/lib/perf/libperf.map | 2 + tools/perf/Documentation/perf-record.txt | 7 ++ tools/perf/Documentation/perf-stat.txt | 6 ++ tools/perf/builtin-record.c | 26 +++++ tools/perf/builtin-stat.c | 18 ++++ tools/perf/tests/cpumap.c | 22 +++++ tools/perf/util/evlist.c | 115 +++++++++++++++++++++++ tools/perf/util/evlist.h | 3 + tools/perf/util/target.h | 9 ++ 11 files changed, 254 insertions(+), 3 deletions(-) -- 2.25.1