Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2741614pxu; Mon, 14 Dec 2020 09:48:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEukAGlDiWZN3MfllKjYKV5Z74AGld+JhKw3eB2ZL1AIhCBFNse95ghBaCbp83XlSAFS4z X-Received: by 2002:a05:6402:142f:: with SMTP id c15mr26089225edx.33.1607968094381; Mon, 14 Dec 2020 09:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607968094; cv=none; d=google.com; s=arc-20160816; b=WBtJJMRLKFd5rC3y6EVTD+vNBCATbg/lPzaLVc3+PFqCIehR7chMntBVmOhO0Ng/Fr RQVSXleGFINqlSBbzQQZyiBaGSnz/5RhnztYD1mQy1gtfKS1o8/c+C2VPV3OawcWzk3g dDk+LxVPRQo1/HaThlax3LR4lteeyDwUmSkPoikL01aAke3qqwBf+3a9VQ/behMzsWLW cahP6wuGrVWf/Ls7/Wd/0ycKiMr4UdeSWi1eAtFqnyp/277oVZzE1BuFCMW6sjJIuwus +W1z8OXlIOTI1A5NRdEdzahE0a6bpjSCjR1mAFl+tt3Nkh3DLcjbbkbo9rykz1Pbk5bE l59A== 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:dkim-signature:date; bh=VBqzOdO5EJHS27GstoK5hoeMCmg8IpOaQdr5CiCtH+U=; b=sS/319sj3ZeyLtjXOwaTgoijFYih19vviMbKh+mzJNkUuYtT6uD8c8TFvGV7u+dPpW qg9UIhXWVTQRvbLff/kIbQpfpws1qNgmg9tHsL+dOPotd5jPP1LQ8Qz5oum53o/00jyt syFA0gSra0zHt3yIcGzEQpkKXzeBcpJAHiGyKGEc0rA9mhyiqMhzoNTi9CXF+EZQc2Vf Vu9Q6t9MNlw/hsCCbNNoV0S5XMswltwVGOSFc7/OSD+zsU0Wfyxiy4xo4JXoV9k2IfrW KRYNONySdKbfX7BDautXWmkrPOeefx4HxbRqC//ChVqOxfOmFr6ehGXPmxNwBna4O6Jh V5uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Kx/AbBMo"; 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 dv23si10151351ejb.408.2020.12.14.09.47.50; Mon, 14 Dec 2020 09:48:14 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Kx/AbBMo"; 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 S2439815AbgLNN3L (ORCPT + 99 others); Mon, 14 Dec 2020 08:29:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:34468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439784AbgLNN25 (ORCPT ); Mon, 14 Dec 2020 08:28:57 -0500 Date: Mon, 14 Dec 2020 10:28:28 -0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607952496; bh=pEQX7iZK98l3bcWz/kxYd1H8ULpoRp/0e2Gfe5EJZlc=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=Kx/AbBMomhctl9a79sbGXyjL8CyMLEOVQqbwguQTJ3kroSpH5lW3NlD6HebojG59T 91+w4aXkHc28XlDmqKMqBs2rKJpTyrcB2V+7itsJRLii6woj65oSYZC32Oa9wTYUih s0GwCupjkcaSBgdK0IA1J6Zv4AkFB/87KsssDQGMsdzz6Ss9XTmum3qqCqe2rlXcRM wDD3n9ifQpwLcL31sEj7pv+ychEJVtgD/KbJaQwjSJ7Y2M1Gbe43QPohWDkerJLhSo uvb/bxEsQZhPTnKjFHMFESm8IzJetDa4kFpOHhWn/T/JkbMOkXxXhj5k1P1KHJhwHA yg0tk9MYWNmKA== From: Arnaldo Carvalho de Melo To: Alexander Antonov Cc: linux-kernel@vger.kernel.org, jolsa@redhat.com, alexander.shishkin@linux.intel.com, mark.rutland@arm.com, namhyung@kernel.org, mingo@redhat.com, peterz@infradead.org, ak@linux.intel.com, Ian Rogers Subject: Re: [PATCH 0/5] perf stat: Introduce --iiostat mode to provide I/O performance metrics Message-ID: <20201214132828.GD238399@kernel.org> References: <20201210090340.14358-1-alexander.antonov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201210090340.14358-1-alexander.antonov@linux.intel.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Dec 10, 2020 at 12:03:35PM +0300, Alexander Antonov escreveu: > Mode is intended to provide four I/O performance metrics in MB per each > IIO stack: > - Inbound Read: I/O devices below IIO stack read from the host memory > - Inbound Write: I/O devices below IIO stack write to the host memory > - Outbound Read: CPU reads from I/O devices below IIO stack > - Outbound Write: CPU writes to I/O devices below IIO stack > > Each metric requiries only one IIO event which increments at every 4B > transfer in corresponding direction. The formulas to compute metrics > are generic: > #EventCount * 4B / (1024 * 1024) > > Note: --iiostat introduces new perf data aggregation mode - per I/O stack > hence -e and -M options are not supported. > > Usage examples: My first thought was: Why not have a 'perf iiostat' subcommand? You're reusing the aggregation code for 'perf stat' and for that I'd love to have Ian, Andi, Jiri et all to look at how you implemented it, but I think having a shorter way of using this would be interesting :-) - Arnaldo > 1. List all IIO stacks (example for 2-S platform): > $ perf stat --iiostat=show Would be: $ perf iiostat show > S0-uncore_iio_0<0000:00> > S1-uncore_iio_0<0000:80> > S0-uncore_iio_1<0000:17> > S1-uncore_iio_1<0000:85> > S0-uncore_iio_2<0000:3a> > S1-uncore_iio_2<0000:ae> > S0-uncore_iio_3<0000:5d> > S1-uncore_iio_3<0000:d7> > > 2. Collect metrics for all I/O stacks: > $ perf stat --iiostat -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct $ perf iiostat -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct > 357708+0 records in > 357707+0 records out > 375083606016 bytes (375 GB, 349 GiB) copied, 215.974 s, 1.7 GB/s > > Performance counter stats for 'system wide': > > port Inbound Read(MB) Inbound Write(MB) Outbound Read(MB) Outbound Write(MB) > 0000:00 1 0 2 3 > 0000:80 0 0 0 0 > 0000:17 352552 43 0 21 > 0000:85 0 0 0 0 > 0000:3a 3 0 0 0 > 0000:ae 0 0 0 0 > 0000:5d 0 0 0 0 > 0000:d7 0 0 0 0 > > 3. Collect metrics for comma separated list of I/O stacks: > $ perf stat --iiostat=0000:17,0:3a -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct $ perf iiostat 0000:17,0:3a -- dd if=/dev/zero of=/dev/nvme0n1 bs=1M oflag=direct > 357708+0 records in > 357707+0 records out > 375083606016 bytes (375 GB, 349 GiB) copied, 197.08 s, 1.9 GB/s > > Performance counter stats for 'system wide': > > port Inbound Read(MB) Inbound Write(MB) Outbound Read(MB) Outbound Write(MB) > 0000:17 358559 44 0 22 > 0000:3a 3 2 0 0 > > 197.081983474 seconds time elapsed > > Alexander Antonov (5): > perf stat: Add AGGR_IIO_STACK mode > perf evsel: Introduce an observed performance device > perf stat: Basic support for iiostat in perf stat > perf stat: Helper functions for IIO stacks list in iiostat mode > perf stat: Enable --iiostat mode for x86 platforms > > tools/perf/Documentation/perf-stat.txt | 31 ++ > tools/perf/arch/x86/util/Build | 1 + > tools/perf/arch/x86/util/iiostat.c | 460 ++++++++++++++++++ > tools/perf/builtin-stat.c | 38 +- > tools/perf/util/evsel.h | 1 + > tools/perf/util/iiostat.h | 33 ++ > .../scripting-engines/trace-event-python.c | 2 +- > tools/perf/util/stat-display.c | 51 +- > tools/perf/util/stat-shadow.c | 11 +- > tools/perf/util/stat.c | 3 +- > tools/perf/util/stat.h | 2 + > 11 files changed, 625 insertions(+), 8 deletions(-) > create mode 100644 tools/perf/arch/x86/util/iiostat.c > create mode 100644 tools/perf/util/iiostat.h > > > base-commit: 644bf4b0f7acde641d3db200b4db66977e96c3bd > -- > 2.19.1 > -- - Arnaldo