Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2126693rwp; Fri, 14 Jul 2023 00:49:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlF7bIy+yx2ThKmPn4RsEcjawcdbw56jlMGcXipj+64vLvUfR4M5fyBr/kGMt7UJnoHe9l5r X-Received: by 2002:a05:6402:1392:b0:51e:6a:b4ba with SMTP id b18-20020a056402139200b0051e006ab4bamr3098666edv.41.1689320982680; Fri, 14 Jul 2023 00:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689320982; cv=none; d=google.com; s=arc-20160816; b=Yi2GZBPPaQHhGaf9DCx+WZOHcw02ewmcitJgvZV6V40nxvDUS3tYOfddT0OEgoXk44 tbnDkKk/ergqUOn75oCC/b3CC3M3SBsWiEPEHWCPzzajmBqnFMGk0UMpHygbpSfxxy3P H1lTEfIaEFlEWU+6XOwAqCo45tFMRTY+7e8hYoNjKMqbFRynUn18xqAo6lTu06TwdWiG yxLEjnuVh6K67eG1XiZTBVIuZjHiskAr1gpBeQl896pCNo3NUljjD7Wrgzf5HbFF7K0x X2I6DUNczRSPXkvetno+apnymobvdTMeQtbdniwkti7gt3sNWk4wcJWgBHc/HQpA6+dr ZhuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=eZuMnpOPQuBlIuHt/zAJgex+OoUoWM5Tu3tPzw9648E=; fh=ZxKMXHpa6WWI7VVDR0DvH64XPqyR4+E/ev+ZKnPIfZ8=; b=OqqQSMCUnK3dDvo3ClxC68gYXPGnFm53aw9iBThAZrPF/txyc8mbzVQljkVGCbK+vO ujxjaGorQj+pUVsdpk9B02mTDPTdibTEq4U5IiBWOOHLkXMgLMgRRL32ksbqifnltX6A ukDj7vdKMM7SF3pySzLT03yyqpYXynJDilQjCL6dvtMaFIQdRZ5qjONY2/B3wO9bCTgL vrICNsFZHaHmLnk8qC/n/GDOBPUSw+khPXHk0rf9cWyCcNnlb7mJ6pK6c+vs5tOFx2eW CjZojfZ9tYHLQBM6mHJT2lcSGf6qQmKHMmd7kGljH/KI9zT/b7W+rMPklBrxWxQ7/ZEZ hjdw== 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 f24-20020a05640214d800b0051be9317ccasi8891147edx.508.2023.07.14.00.49.19; Fri, 14 Jul 2023 00:49:42 -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 S235356AbjGNHTz (ORCPT + 99 others); Fri, 14 Jul 2023 03:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235077AbjGNHTt (ORCPT ); Fri, 14 Jul 2023 03:19:49 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 045F830E8; Fri, 14 Jul 2023 00:19:36 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R2N7M2t7jzNmSX; Fri, 14 Jul 2023 15:16:15 +0800 (CST) Received: from M910t (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; Fri, 14 Jul 2023 15:19:32 +0800 Date: Fri, 14 Jul 2023 15:19:14 +0800 From: Changbin Du To: Adrian Hunter CC: Changbin Du , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , , Subject: Re: [PATCH] perf: add new option '--workload-attr' to set workload sched_policy/priority/mask Message-ID: <20230714071914.3jro4kfcvhun2ptd@M910t> References: <20230713085831.395112-1-changbin.du@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: 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=-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 On Fri, Jul 14, 2023 at 10:06:31AM +0300, Adrian Hunter wrote: > On 13/07/23 11:58, Changbin Du wrote: > > To get consistent benchmarking results, sometimes we need to set the > > sched_policy/priority/mask of the workload to reduce system noise. > > > > For example, CPU binding is required on big.little system. > > > > $ perf stat -r 10 -- taskset -c 0 ls > > > > Nevertheless, the 'taskset' is also counted here. > > > > To get away of the middleman, this adds a new option '--workload-attr' to > > do the same jobs for stat and record commands. > > > > $ sudo perf stat --workload-attr fifo,40,0x1 -- ls > > > > Above will make 'ls' run on CPU #0 with fifo scheduler and realtime > > priority is 40. > > Aren't there ways to set up a process then start perf using -p > then let the process continue. > By that you need a mechanism to pause the new spawnned process and wait perf to attach. Or setup the sched properties by the app itself. But sometimes we just simply want to run the app through and measure some events. With --workload-attr, we do not need extra setup works. -- Cheers, Changbin Du