Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1186701pxb; Wed, 10 Feb 2021 02:11:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxD2mgTFA9L2uJaRdnf96k328FzoqtIksm3BUZs+4LMAn/D4eqTBm2NU0lSfKR/OuZeJ8xD X-Received: by 2002:a17:907:20a8:: with SMTP id pw8mr1579058ejb.9.1612951868047; Wed, 10 Feb 2021 02:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612951868; cv=none; d=google.com; s=arc-20160816; b=P+CqkXlcDR35cKSC6w4XpdnjxinJ6iPoLGemB3TbAshQAy/wh7qW21UTkWlSKiedbS pd6rf8NZjDW2Ysiwv2kFwRXQx8yxDIajXe/v2xr1CuthpZQKO914gywYc3sYqFIC4P8A qZZa+PEYG8CyzsMWdrAN9yUBH8muiNPyHnry14fX4H0WSyfURMCAHaBZJdOY8OtyQav6 HzOVpNBwz2ko1cbd9ytfGdLYghZNz8EsLgBp5/A7KlP5g2ijc3WLrHayTJiq2U55QlA9 +JaylqDad4k71ummAx4osXJ7WF2QQ0V9k6KBHSeJL1Tta4RpJ7tWCtTF+8rkMAbr5jye IZUg== 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=IyOc8UZclGkkqMx3r2c0BfRAQrI7zkn3IXNIIgsvPl4=; b=wKoLjeJjtL/aMnlXL6zB/ybzY9ysv4qBGZJiDt4VRluqE+G1puhBgqMqYGzH+e0TGN cyBArDCtMJi2NhGy70m+yOmgUD5OIp3gGyZPUY58QUHH9d83pBDoz5/S+Txu484Ka/el WQh4wwEoF/JH4MqF0X3I9HqyE9Z54wDIWlWo2NUqcDcB4VoKlqHlV3IVy6mOwgfb1G8B hPirprTeJrazqUNJm9M5/0CpTnBQopW/udxFqj9719Bu/x6uKcavpjaWtgjriCTqHLCg v3SJJgdU08rCDwRyEltfp0YDifAY34LTAd2JD56LbImU+aJS3+alYN1LtYRJdZn2prkN gX6w== 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 gz13si975563ejb.726.2021.02.10.02.10.43; Wed, 10 Feb 2021 02:11:08 -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 S230177AbhBJKG0 (ORCPT + 99 others); Wed, 10 Feb 2021 05:06:26 -0500 Received: from mail-lj1-f178.google.com ([209.85.208.178]:33872 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbhBJKDA (ORCPT ); Wed, 10 Feb 2021 05:03:00 -0500 Received: by mail-lj1-f178.google.com with SMTP id r23so2044735ljh.1 for ; Wed, 10 Feb 2021 02:02:44 -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=IyOc8UZclGkkqMx3r2c0BfRAQrI7zkn3IXNIIgsvPl4=; b=b3fXErRSHRFwRtTvAxnEdvAhWwQNY4XFojXEDNgzjS+c24tMhZFRvsCZKyBmEw4nGn hPoIII616FSux4800wEoFVEnQ9eRPeFMYNAMTYh+RsFHxtkHyxJO2jgnuekzrRp/tGh2 9mtOe+leBfkKEGkJmnlv++WCvWQpvL5xFe9bCsmij3CXGN7ZevyzQvB+sD/HJ1A6ucWO xMf6gKV5ZUEJ50Xd1fydj6AejkniPzeIszHeYDnH0oOPd/cr6NXWNAgyWYgAonzgDtvf VVZj7fz4uMknlkQMK0jfmUoOQynCS1HnBAjQVlcU5EFVHfcyiCjbPkx/cGxW0Pfws/Ak OzaQ== X-Gm-Message-State: AOAM531GNSeqhKAK7Nis6KL7kW9EauRZG9rnIm61VtjeK3EhC892725e ZR57EObnY3AGRr5uxjsB3yYneMOGvlx2Th9696Q= X-Received: by 2002:a2e:5016:: with SMTP id e22mr1478551ljb.166.1612951338429; Wed, 10 Feb 2021 02:02:18 -0800 (PST) MIME-Version: 1.0 References: <20210203135830.38568-1-alexander.antonov@linux.intel.com> <20210203135830.38568-2-alexander.antonov@linux.intel.com> In-Reply-To: From: Namhyung Kim Date: Wed, 10 Feb 2021 19:02:06 +0900 Message-ID: Subject: Re: [PATCH v4 1/5] perf stat: Add AGGR_PCIE_PORT mode 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 Mon, Feb 8, 2021 at 8:31 PM Alexander Antonov wrote: > > On 2/4/2021 3:07 PM, Namhyung Kim wrote: > > Hello, > > > > On Wed, Feb 3, 2021 at 10:58 PM Alexander Antonov > > wrote: > >> Adding AGGR_PCIE_PORT mode to be able to distinguish aggr_mode > >> for root ports in following patches. > > I'm not sure adding the AGGR_PCIE_PORT is the right way. > > In my understanding, the aggr mode is to specify how we aggregate > > counter values of a single event from different cpus. But this seems > > to aggregate counter values from different events. Also the new > > mode is basically the same as AGGR_GLOBAL. > > > > As you will add stat_config.iostat_run to distinguish the iostat > > command, probably we just want to use the global aggr mode > > (and it's the default!) and get rid of the AGGR_PCIE_PORT. > > > > Thoughts? > > > > Thanks, > > Namhyung > Hello Namhyung, > > Actually, you are right. We aggregate counter values from different > events of a > single IIO stack (PCIe root port) to calculate metrics for this IO stack. > But the reason is to prevent using of '-e' and '-M' options in 'iostat' mode > because it can be a reason for the mess in the output that can confuse > users. > > There is an idea to use your suggestion for this part: > > status = iostat_prepare(...); > if (status < 0) > goto out; > if (status == IOSTAT_LIST) > iostat_list(...); > else > ... > > So, we can check if evlist is empty inside iostat_prepare(). If not, print > a warning, for example, "The -e and -M options are not supported. All chosen > events/metrics will be dropped". Then we can free of evlist by using > evlist__delete(), create new one by using evlist__new() and fill the evlist. > > In this case the body of iostat_prepare() function would be: > > iostat_prepare() > { > If (!is_evlist_empty) { > pr_warning(); > evlist__delete(); > evlist__new() > } > > iostat_event_group(); > } > > It will allow to get rid of the AGGR_PCIE_PORT. > What do you think? LGTM :) Thanks, Namhyung