Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3930791pxb; Mon, 8 Feb 2021 03:55:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh9RmmAYaiX6oYYpBkXGqEJ5QM9fU2OKglcWNSPuqu8LrdID4etJIzD1RVik3dnW7RK1Ho X-Received: by 2002:a17:906:a153:: with SMTP id bu19mr16964415ejb.287.1612785346185; Mon, 08 Feb 2021 03:55:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612785346; cv=none; d=google.com; s=arc-20160816; b=m3zzvPJ/hGmQV58bcPeIAqdZr6zL/oTjGEjB6jb3T8/ROTlb2ySeTSIAkarRwp5R/q tTiBWVxC7HTPri06Ldrui0IcXBInZ+1En8dbgQdafYGPxt9v89lpS3sQdTt/RPvFnlPG 0IDrKbiwx/IcFwHbheyAf28gPja9zq/JawOT4RpOY2EQ+omZXhJBzXQ61vtxO/fH1TA0 AtPr5gc0iNoPti4pYbTnk7YiKiYfESDldFEybn9dLaujvqrhXnurEIkQqTpowO2d8zR9 nRAFBHsXn14JqJ22V2A8hut5aJBDgDsILbgsngly60NtAW3Ge4u6tPbqqZu4e2sQydDG BFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=24mVzzTx8SxoUgLP7JKcxZOLQ0r0yF95BiCmb+yXrso=; b=rmR3/eQQD6GX5aZVxxdNB7nk5RvjPuRX8BMlwbvwixQSoKOUQXuVKQ4gd61Nz1UiYs DsFlYPCbpS2tfDBLOT9qiP5WxxjCR7TWSS2MF9vOHQ5pveyVrjBu9yexyQ1/4tQz7ENy 6N/33xPDjSrQJvJCgLf06d2C5UrugYQJ9EQRXwC3T1IkB+002CyPnPYgLbJTWSh7dUS5 WhQcFSSpR5kYCz7JslH++9BDPeeqD4iZ3qtVFsmLF+HVZtOncUJJQkTZ7idFW6Aux0P3 j8eBlA2PDGEpNV+KlB8yYVd2Z2JNV/fwK7U2Vr9mDPr2WWyOy1ST5YE21+DM82brYjFK tFIw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 63si731092ede.541.2021.02.08.03.55.22; Mon, 08 Feb 2021 03:55:46 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233205AbhBHLxr (ORCPT + 99 others); Mon, 8 Feb 2021 06:53:47 -0500 Received: from mga05.intel.com ([192.55.52.43]:17790 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233379AbhBHLcv (ORCPT ); Mon, 8 Feb 2021 06:32:51 -0500 IronPort-SDR: L9Pt/0YL0s4BWtTwzZe6DsrXRR6+pWHp/9Mzh+toIeX8ad6z8Ak5fscpiVCppC1S2V/xuL86xm cY8LorCmUEhg== X-IronPort-AV: E=McAfee;i="6000,8403,9888"; a="266529388" X-IronPort-AV: E=Sophos;i="5.81,161,1610438400"; d="scan'208";a="266529388" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 03:31:06 -0800 IronPort-SDR: wKC0xb71HFAS2oNzCVfz/ORnkv6TRYolKG6RZoIR6+w81WOg+MSC41NPQTPWv+wiBrX0RDQiha 1Ysr64QsUqsA== X-IronPort-AV: E=Sophos;i="5.81,161,1610438400"; d="scan'208";a="395350823" Received: from aantonov-mobl.ccr.corp.intel.com (HELO [10.249.226.173]) ([10.249.226.173]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 03:31:03 -0800 Subject: Re: [PATCH v4 1/5] perf stat: Add AGGR_PCIE_PORT mode To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , linux-kernel , Jiri Olsa , Andi Kleen , Alexander Shishkin , Mark Rutland , Ian Rogers , Ingo Molnar , Peter Zijlstra References: <20210203135830.38568-1-alexander.antonov@linux.intel.com> <20210203135830.38568-2-alexander.antonov@linux.intel.com> From: Alexander Antonov Message-ID: Date: Mon, 8 Feb 2021 14:30:21 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thank you, Alexander