Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp204189pxb; Fri, 15 Jan 2021 00:39:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJz98Afr20nuU/Yemzs4q1M0cy8d1AC/p6jIIVBU/FDm9M0eFjXC/FSQk2DYcbH+e+G7vniJ X-Received: by 2002:a17:906:43c5:: with SMTP id j5mr8340328ejn.530.1610699998147; Fri, 15 Jan 2021 00:39:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610699998; cv=none; d=google.com; s=arc-20160816; b=ORiICtWBiXiu6zL7P3VEK++TlTZnj0HdYSVoZ9hCR/O5GN0WbnFfpmUwR2JkN9oUtX k+voroDuEch5ixmmFG6wqOuw0a3a9tPnuh7/Flm7Y9UnCgo3ZEi1XuP1Mrix/E4t9mx5 opBkARok9qOXiDgdxBM5J7W3pY7QXkHMHdWU6xpUeTlvajAM4lvmTAShpwrCD1rJSCI1 36AhuuXYrY4OUkxo4XCQxCA8Cm88gdsWA6Fh2im/owfNqyaL2Q1vjKgzPE3CX9B5rmuf 66PcN3TA5e4WwC9AuZFHZ3sSW69+cNHo1KilZkfRVcjxwx44ZSDkLXAaznuqLTPDT0SX dYTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=h9UhJeIAP+EngKocS/zCFbSC4TCvXsJ8kqGSBlPi5Ow=; b=R2wW7NeM5yXDap9DgIo/octod+5UQGmfys1N3f5DMt+GzV5kEhICfmz1uN/0fUM2wF k16EGuXdIGJvWw9D04367al/sAN31gRtmpT8Rk45pjphXz9k67RQyeiecZHzSohlFKsv +ruK+5O/KqJ8U7MaX9Bj+ngOrVZXNr8Fgb8wz2/+k+Lylehtl8ve8IyBhKfC5hS83yca x9D6E+EktqmckMLRxq785SjRZrXotHu8/i5cOSrg48xjF2PKK1qIu1/PaNAWqmGTHH8x NjEysPXMKBmxGxwB2Pgt10gEgdMql5amBUSdND96vNZ22V62gYQPIyerrbPS/jV5b7a3 NHOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si3811675edq.184.2021.01.15.00.39.34; Fri, 15 Jan 2021 00:39:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731602AbhAOHee (ORCPT + 99 others); Fri, 15 Jan 2021 02:34:34 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:46193 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbhAOHed (ORCPT ); Fri, 15 Jan 2021 02:34:33 -0500 Received: by mail-qk1-f177.google.com with SMTP id d14so10844870qkc.13 for ; Thu, 14 Jan 2021 23:34:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h9UhJeIAP+EngKocS/zCFbSC4TCvXsJ8kqGSBlPi5Ow=; b=sl5fAQWXESxkZuL48PZxVbhtPTCceQiNCMC+6AH/gwPdFaj1mFNZKsrEf+ilQbjYoi LTq3NG6TCzwybJ7lt58bpzf9XZP32UYnWPRNAB15urrRBSAl/kYbIvNFnoi2vIces+le 10Cu6pb8LFCYYqnKONgtkW3q1LDGZxDiP6RoZJfQ/ZcbyZ/3IwQbH6/HkOZf/d4v3o08 EQgbm1JZ/zVMSGiwyy2psHjOKbC7U/6COm/X1/NmjtmYueLkQ10o7rVtRdjl5d2xd4R9 RdIHfERo0dbG79nGQCsTfCP/Q/qsMn135n3eppOw9hxMpsTFKVHC02ht77mRWONFBQq6 kieQ== X-Gm-Message-State: AOAM530fKVKz7tYVSgyi7QE/XoTpYCHe/iH8qTIPLIF/FZ2xtheC9O/2 +srDm4NSm7mWuHxC5POqdQUjG/mRd+CHeQBzYHc= X-Received: by 2002:a37:4bc1:: with SMTP id y184mr11092398qka.278.1610696032470; Thu, 14 Jan 2021 23:33:52 -0800 (PST) MIME-Version: 1.0 References: <20201223130320.3930-1-alexander.antonov@linux.intel.com> <20201223130320.3930-6-alexander.antonov@linux.intel.com> <358dd76f-c6ec-b894-14be-659df0802c87@linux.intel.com> <20f98862-9087-0368-7124-19a8f2b54db9@linux.intel.com> In-Reply-To: <20f98862-9087-0368-7124-19a8f2b54db9@linux.intel.com> From: Namhyung Kim Date: Fri, 15 Jan 2021 16:33:41 +0900 Message-ID: Subject: Re: [PATCH v2 5/6] perf stat: Enable iiostat mode for x86 platforms To: Alexander Antonov Cc: Arnaldo Carvalho de Melo , linux-kernel , Jiri Olsa , Andi Kleen , Alexander Shishkin , Mark Rutland , Ian Rogers , Ingo Molnar , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 1:41 AM Alexander Antonov wrote: > On 1/14/2021 6:39 AM, Namhyung Kim wrote: > > On Wed, Jan 13, 2021 at 9:08 PM Alexander Antonov > > wrote: > >> > >> On 1/6/2021 12:02 PM, Namhyung Kim wrote: > >>> On Wed, Dec 23, 2020 at 10:03 PM Alexander Antonov > >>>> diff --git a/tools/perf/perf-iiostat.sh b/tools/perf/perf-iiostat.sh > >>>> new file mode 100644 > >>>> index 000000000000..2c5168d2550b > >>>> --- /dev/null > >>>> +++ b/tools/perf/perf-iiostat.sh > >>>> @@ -0,0 +1,12 @@ > >>>> +#!/bin/bash > >>>> +# SPDX-License-Identifier: GPL-2.0 > >>>> +# perf iiostat > >>>> +# Alexander Antonov > >>>> + > >>>> +if [[ "$1" == "show" ]] || [[ "$1" =~ ([a-f0-9A-F]{1,}):([a-f0-9A-F]{1,2})(,)? ]]; then > >>>> + DELIMITER="=" > >>>> +else > >>>> + DELIMITER=" " > >>>> +fi > >>>> + > >>>> +perf stat --iiostat$DELIMITER$* > >>> Why is this needed? > >>> > >>> Thanks, > >>> Namhyung > >> Arnaldo raised question relates to format of 'perf stat --iiostat' > >> subcommand > >> and explained how it can be changed to 'perf iiostat' through the aliases > >> mechanism in perf. > > Yeah, I know that. What I'm asking is the DELIMITER part. > > > > Thanks, > > Namhyung > I'm using DELIMITER to resolve two different cases for format of iiostat > command: > The first one is the command with an option for iiostat mode, for example: > 'perf iiostat show' which should be converted to 'perf stat > --iiostat=show' or > 'perf iiostat 0000:ae,0000:5d' to 'perf stat --iiostat=0000:ae,0000:5d'. > The second is the command without any option for iiostat: 'perf iiostat > -I 1000' > should be converted to 'perf stat --iiostat -I 1000'. Can't we simply use a whitespace ? Thanks, Namhyung