Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9382311rwp; Thu, 20 Jul 2023 04:15:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsYpGlyAu12YRSUJ5IigS46neLFqD0tbhpn7KxmsUDBaBGSqlU8hoZVzvc5p6DPSZGVm7h X-Received: by 2002:a17:902:b58e:b0:1b8:b382:f6c6 with SMTP id a14-20020a170902b58e00b001b8b382f6c6mr1270675pls.9.1689851730758; Thu, 20 Jul 2023 04:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689851730; cv=none; d=google.com; s=arc-20160816; b=WNGK5cyAKOlmVpX/0jT16bz+SrWJJTW1iN/Wk8JmzCyJOnv4cB7P7gMhtOFh2S/8I7 m3MGnr2kRyafRiDA4ef+KRhe5Uck4E0rQuFTkyCSE9Mb74lvd3sFfqyqcj8iSfYPuRtC 56tNewD37p+8QKhGikT5a2rVf/iWFU+uyxLJvM4URX8+Q3E9EjHu6IzwhDU2WorrIJWc RI2kt989bEQ7gXc6kukrqhX9Ta0ZIDeqh78792iAvGvzDNi5yzi2leKrlfGzqZAcoS9w KOFMp4Ntt67uXJ+bjngd7bwNel0jSDDu3b56R785IIap/nJbQL20tRw+BRUkQJsXuHgF BzDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:content-language:references:cc:to:subject:from :user-agent:mime-version:date:message-id:dkim-signature; bh=Up6S6iPHRO/ouuGqX2/YqrLUgcT0g/4YHLPzSsAUwAA=; fh=Xaj32n/NQia0EzaEjCsYYTAwT524nfvfjIOUaxUoIC8=; b=l3RAPJR2hq5eQEt414N5m+aGZr1Y3HJ4zVd0HCdV8F7Vb2OoHRCFpQAziT+A13slaW uOcZWWzBN/WpbvLVSWLygdPSiSzYbFtqcHujD+XTABr436/5G7WsV5b+x82kWUlKKYLr p37Lv2yiYc57qkRtL1fp/DRzXK3OsEUnzWJPTyKTAWoLe2C/uKmWMVuax90lxIveXWwS AhXipKurPiNP9AQhhhqj2dq1Ywprb6nM5BMvVSB2D/6Iccc3Xj0cSmWnlJlxD00pbCuA d1PnQrnCI0Oro9Nsw5NnBdjbp8zMFaRRypGKPbQvW2bIolD7MhLnDhoXmIQXE+5obmgP wIyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V2a3f2Ci; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170903124600b001b8bab3d5dasi854724plh.108.2023.07.20.04.15.16; Thu, 20 Jul 2023 04:15:30 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=V2a3f2Ci; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbjGTKBO (ORCPT + 99 others); Thu, 20 Jul 2023 06:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbjGTKBH (ORCPT ); Thu, 20 Jul 2023 06:01:07 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345C1FD; Thu, 20 Jul 2023 03:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689847266; x=1721383266; h=message-id:date:mime-version:from:subject:to:cc: references:in-reply-to:content-transfer-encoding; bh=6K2m70PwHB5P+4FJyncCXsXVleOk0EtZEdMx58MuRo8=; b=V2a3f2CiQc1tq2ZSemwkz9PfhVMaJTgfmZmnsgPKgT69Zp0HHD3yphNd PL0SICsXrREs77m8W6TpLfbfarKYlsFluK/l/dw87rALPNxtkAVTjgs/s G406rLRyIl/FWYAB5PA+fQkKM0ONRo3B6IdRcVa/3AyGdkmD0wTgNK7+b xxvIZ8qG9d+4Kwt1h2u5T8nOx60U68aJwkOxb3DKiQ+lakrL8LYtGXIGG GF0YTtEX+UEW0XeTE8n6QlgvaTdXLgyPy8saB84sUfBkF5qVY15TpD3fD 2gNgSIJjtwy0s8ZVAXnsy1GFN2ZCXJ8oM7PU+APmZ9DSVS53phVWnFY6l A==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="351553640" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="351553640" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 03:01:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="794402832" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="794402832" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.32.109]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 03:01:02 -0700 Message-ID: <5889e93b-5ee3-8d59-c2fb-bce7070a1ab2@intel.com> Date: Thu, 20 Jul 2023 13:00:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 From: Adrian Hunter Subject: Re: [PATCH v3 0/3] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask To: Changbin Du , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Cc: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Hui Wang References: <20230718033355.2960912-1-changbin.du@huawei.com> Content-Language: en-US Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20230718033355.2960912-1-changbin.du@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,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 On 18/07/23 06:33, Changbin Du wrote: > 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 Not really sold on the need for this, but maybe it could be simpler. What about just adding a hook for a command (e.g. script) to run before exec'ing the workload e.g. --configure-workload=blah.sh results in perf doing system("blah.sh 12345") where 12345 is the workload PID. Then maybe you could do: --configure-workload="taskset -p 0x3" > > Please see patch 1/2 for more details. > > 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 (3): > 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 > perf: replace taskset with --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 ++++ > .../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 | 117 ++++++++++++++++++ > tools/perf/util/evlist.h | 3 + > tools/perf/util/target.h | 9 ++ > 16 files changed, 263 insertions(+), 9 deletions(-) >