Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3476371rwo; Mon, 24 Jul 2023 11:34:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlGuw1UOCT3shREQC9+UzSByQSjLYkNJo+olpxB4/KZrdKn6W1uSC/+40tJU85MwhxiCFSEs X-Received: by 2002:a17:906:8a73:b0:993:e695:b585 with SMTP id hy19-20020a1709068a7300b00993e695b585mr10587ejc.9.1690223680519; Mon, 24 Jul 2023 11:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690223680; cv=none; d=google.com; s=arc-20160816; b=KK5TgiLTPnxG0kDkGCFobjlUe8Zn4vmMOcq8QSF0CRdmGV6kWV9aHgTvMiZoepDzlX //dxB7VmRjGBWEcbG1bPAHUcCCJSVvrRBvM0Qllm4RoYtmqJdFyILfZ7oDgyDIZDAYcQ Go16je2FOhw8GkcHy9Algca0mS2rd7LpgcgK/F5xVZ7Ab2h43pQtXaQSVK27a2qsNqQV Oo5JN49jhU8k2vVhVC/Wt6zZM7OsyZ4VY5dfK29ychpAri1YibXSo2KLqG7Sai+yiP1v Yf1tag3Lqv89kWMd1QkR/Y0YuFYvaGkhkDsYtT2i/zmhY2Ieie8tP4tE7/4ldkBdeHPl zIzw== 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:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=z8io3NdGY4VQE+WxGQ1yU6dPg42oHslAxEyEf/huwO8=; fh=Sw6M8ggQNnP7jm9gljqK0I+DGSgeJ5fG9XHfE2FA7wY=; b=byuWmO88ed88oaFtj3thJaDfLa2lP2ZllYrCvzXTB7V0kFORi1E0iV3nOrSDf3S6TR Uj92V6a5K1vVebAjKjRcrcWe0c0WtnnTvcq7Dlas42CHtMVnHdcq1ycU6hcDqP6522Lz 8XrIk1hT72sxEkrdd7ks2Yizvc1FkmYRW8VKvGYOdtj72u480yxgKDRsoCxRUM0GKf5I sjeItIOZiPVct9ovv+bTA9tYycN2O9f8aIW0F9ZjzmYu4WK9S6HoVizg7g1WXGL02+1P YmmqSPlig2o4yygaBDZmvoyWCpgSCqdvz1YSOwvTCzZUMcPv0uyOzGNKyl2DiuR25rUC 5E1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cLnfm291; 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 f7-20020a170906824700b00991cbb3d4a6si6599830ejx.115.2023.07.24.11.34.16; Mon, 24 Jul 2023 11:34:40 -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=cLnfm291; 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 S231926AbjGXRyY (ORCPT + 99 others); Mon, 24 Jul 2023 13:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjGXRyF (ORCPT ); Mon, 24 Jul 2023 13:54:05 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E77B3C3A; Mon, 24 Jul 2023 10:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690221130; x=1721757130; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=A7TMcwc2FKHptC0Rm44KdH9oKvYd6rBLX1wakGjXXak=; b=cLnfm291kkOd6uQ28uFyTx9/d4C04N5qc1X/3pYaFcWj5buljxOLLZV5 vMzRAp7ZW5cbZPpxSi1aAK3sDP7hoeklhytXQYFNq7QomLY5FF8WGSkME OtCfwedITwz7H4oyCxHs8B6b1eHCGVyA0edRslwenTv4DDMksOzLy4fAr yuPwhQBNfK79A2ljFbbzVflq1q28Jq4NSJ4mG7W3H6WuUWpDAR5/NUkWD R2K2qdm4ytt4ZbVWg9WV1l1xMNxP3FvrgXS6koXDi6acGXgNqzpoiqQlQ kyM58iPnZkwIhRxxqgLWnlr6GfqkSMbzWkcyxUFVji1zTUcdr/ahZaH0N A==; X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="367538804" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="367538804" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 10:51:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10781"; a="729005959" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="729005959" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.33.18]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 10:51:20 -0700 Message-ID: <5a24632a-4293-3009-e4c6-e81d6ceb8f07@intel.com> Date: Mon, 24 Jul 2023 20:51:15 +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 Subject: Re: [PATCH v3 0/3] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask Content-Language: en-US To: Changbin Du Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , 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> <5889e93b-5ee3-8d59-c2fb-bce7070a1ab2@intel.com> <20230724040229.eipq7i43v4xcrq3p@M910t> <05b67e8c-6ba0-5774-93fd-d390ac4e3b19@intel.com> <20230724093418.ntluetxruz3ufqnl@M910t> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20230724093418.ntluetxruz3ufqnl@M910t> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 24/07/23 12:34, Changbin Du wrote: > On Mon, Jul 24, 2023 at 08:44:12AM +0300, Adrian Hunter wrote: >> On 24/07/23 07:02, Changbin Du wrote: >>> On Thu, Jul 20, 2023 at 01:00:58PM +0300, Adrian Hunter wrote: >>>> 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" >>>> >>> Acctually, we already have such option for perf-stat. >>> >>> --post command to run after to the measured command >>> --pre command to run prior to the measured command >>> >>> By involving a shell script we can do more complex setup. But sometimes I just >>> need to set sched attributes. For example, to investigate the impact of >>> various compiler optimizations. In this case, I don't want a script. This is the >>> original purpose I try to add this new option. >> >> There is also command schedtool, but what exactly is the problem >> with a script? >> >>> > There is no problem with a script, just a shortcut for convenience. When I want > to share perf investigation with somebody, I just need to share a single commandline. > Anyway nothing bad, right? :) Also depends on what you call a single commandline, since you could always create the script and run perf in one long line :-) I would still go for the simpler option: easier to maintain and potentially more flexible.