Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2122086rwb; Thu, 27 Jul 2023 02:19:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEPasPti5iJWIzTuAtk7yORPR0KRgsNzO+p0zvAOCkoPcBqVGhZBqQjj/EI0lXuifnQX0f X-Received: by 2002:a05:6a20:9381:b0:138:64c4:34b2 with SMTP id x1-20020a056a20938100b0013864c434b2mr4715285pzh.41.1690449575119; Thu, 27 Jul 2023 02:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690449575; cv=none; d=google.com; s=arc-20160816; b=evoE17DhHhGxxAzB9gJXWgry9QR8QKsfteV0lBjhaNWz/MF7ObzjUPYVUXo43qYvCb tiDQdStzbEIXec9BJy4H/nuklzkN/aBUpXVpV2rhexsY78s/o4+ed1TLM6ziKcphg/uZ fkNaItayzsOMME3WvNLnhTZ6zVuopDeT24zWThezrb8CCg5zzOUI3EyApiXEe8wE5LpL OPPJcFKo2h9TxxAI69yYddLuJycbIRca4FKvZw/wrpaFlHAyCPVHgw24yCoimmihXame zV0tmsB47bk2z0A3jY1t/T3sffsn/CltnlqQG/4EgcdnZ0uXoo0b1WUFMYB/0GvhnrIe CCAg== 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=CP90AN1y4upic4uWwZ/bWssc70e1ail/RXFpXEayOuI=; fh=ApeLdK2xurAeWAFDrmxfomKJVPpeLi5+JFM/i5kBxGg=; b=O5wkoUygK+b84k4YxT5BwP0WrGMoQL5aZpBjQnOBlJJco8/DowPaFt5X7AJ0504jfS RRKv8/cFCJH4Z3sYF9Ho5Y+1v3UDwjLqZU5r9xlkmSPNV1MGnZdsCMsQrvTZgNSIpOc+ TtNB/vnMnCa9QIKRK8kBP4I5L1Spe7W7SrK/cCBQ0YFuYgtUn+PcY7xQv+Izr8LuL2Zp JRequQ2KGXH0N3HFe4TPSPdVJMNZj78A/WDZdKyJruGqiGbeI1J7pGFyu3SwnnJIdeWy z77XzEAwI0dmaaFy8L2E03G24QgRtPTPyTP8wpe5Z6PS1NJ2dYDbRZ9j64D/xI0AUk4g zgYQ== 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 a7-20020a170902ecc700b001bb9a1cf6casi1007204plh.405.2023.07.27.02.19.22; Thu, 27 Jul 2023 02:19:35 -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 S234351AbjG0Ir3 (ORCPT + 99 others); Thu, 27 Jul 2023 04:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232900AbjG0IrF (ORCPT ); Thu, 27 Jul 2023 04:47:05 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1747449C3; Thu, 27 Jul 2023 01:29:42 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RBP6c4NHLzrS0H; Thu, 27 Jul 2023 16:28:24 +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:18 +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 0/4] perf: add new option '--workload-attr' to set workload sched_policy/priority/cpumask Date: Thu, 27 Jul 2023 16:28:48 +0800 Message-ID: <20230727082852.916093-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: 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 This adds a new option '--workload-attr' to set the sched_policy/priority/cpumask of the workload to reduce system noise. $ sudo perf stat --workload-attr fifo,40,0-3:7 -- ls Please see patch 2/4 for more details. v4: - add a test case for perf-stat. (suggeted by Ian Rogers) - fix warning found by 0-DAY. v3: - replace taskset with --workload-attr option in documents and tests. v2: - Use cpu list spec instead of cpu mask number. - Update documents. Changbin Du (4): 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/cpumask perf: replace taskset with --workload-attr option perf test: add test case for --workload-attr option tools/lib/perf/cpumap.c | 45 ++++++- tools/lib/perf/include/perf/cpumap.h | 4 + tools/lib/perf/libperf.map | 2 + tools/perf/Documentation/intel-hybrid.txt | 2 +- tools/perf/Documentation/perf-record.txt | 7 ++ tools/perf/Documentation/perf-stat.txt | 8 +- tools/perf/builtin-record.c | 26 ++++ tools/perf/builtin-stat.c | 18 +++ tools/perf/tests/cpumap.c | 23 ++++ tools/perf/tests/shell/stat.sh | 19 +++ .../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 +- tools/perf/util/evlist.c | 116 ++++++++++++++++++ tools/perf/util/evlist.h | 3 + tools/perf/util/target.h | 9 ++ 17 files changed, 281 insertions(+), 9 deletions(-) -- 2.25.1