All of lore.kernel.org
 help / color / mirror / Atom feed
From: "liuqi (BA)" <liuqi115@huawei.com>
To: Alexander Antonov <alexander.antonov@linux.intel.com>, <acme@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <jolsa@redhat.com>,
	<ak@linux.intel.com>, <alexander.shishkin@linux.intel.com>,
	<mark.rutland@arm.com>, <namhyung@kernel.org>,
	<irogers@google.com>, <mingo@redhat.com>, <peterz@infradead.org>
Subject: Re: [PATCH v4 4/5] perf stat: Enable iostat mode for x86 platforms
Date: Tue, 9 Mar 2021 15:51:13 +0800	[thread overview]
Message-ID: <d2f23f76-3557-f6f1-dd0b-2491bb734b00@huawei.com> (raw)
In-Reply-To: <20210203135830.38568-5-alexander.antonov@linux.intel.com>

Hi Alexander,

On 2021/2/3 21:58, Alexander Antonov wrote:
> This functionality is based on recently introduced sysfs attributes
> for Intel® Xeon® Scalable processor family (code name Skylake-SP):
> Commit bb42b3d39781 ("perf/x86/intel/uncore: Expose an Uncore unit to
> IIO PMON mapping")
> 
> Mode is intended to provide four I/O performance metrics in MB per each
> PCIe root port:
>   - Inbound Read: I/O devices below root port read from the host memory
>   - Inbound Write: I/O devices below root port write to the host memory
>   - Outbound Read: CPU reads from I/O devices below root port
>   - Outbound Write: CPU writes to I/O devices below root port
> 
> Each metric requiries only one uncore event which increments at every 4B
> transfer in corresponding direction. The formulas to compute metrics
> are generic:
>      #EventCount * 4B / (1024 * 1024)
> 
> Signed-off-by: Alexander Antonov<alexander.antonov@linux.intel.com>
> ---
>   tools/perf/Documentation/perf-iostat.txt |  88 ++++++
>   tools/perf/Makefile.perf                 |   5 +-
>   tools/perf/arch/x86/util/Build           |   1 +
>   tools/perf/arch/x86/util/iostat.c        | 345 +++++++++++++++++++++++
>   tools/perf/command-list.txt              |   1 +
>   tools/perf/perf-iostat.sh                |  12 +
>   6 files changed, 451 insertions(+), 1 deletion(-)
>   create mode 100644 tools/perf/Documentation/perf-iostat.txt
>   create mode 100644 tools/perf/perf-iostat.sh
> 
> diff --git a/tools/perf/Documentation/perf-iostat.txt b/tools/perf/Documentation/perf-iostat.txt
> new file mode 100644
> index 000000000000..165176944031
> --- /dev/null
> +++ b/tools/perf/Documentation/perf-iostat.txt
> @@ -0,0 +1,88 @@
> +perf-iostat(1)
> +===============
> +
> +NAME
> +----
> +perf-iostat - Show I/O performance metrics
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'perf iostat' list
> +'perf iostat' <ports> -- <command> [<options>]
> +
> +DESCRIPTION
> +-----------
> +Mode is intended to provide four I/O performance metrics per each PCIe root port:
> +
> +- Inbound Read   - I/O devices below root port read from the host memory, in MB
> +
> +- Inbound Write  - I/O devices below root port write to the host memory, in MB
> +
> +- Outbound Read  - CPU reads from I/O devices below root port, in MB
> +
> +- Outbound Write - CPU writes to I/O devices below root port, in MB
> +
> +OPTIONS
> +-------
> +<command>...::
> +	Any command you can specify in a shell.
> +
> +list::
> +	List all PCIe root ports.

I noticed that "iostat" commond and cmd_iostat() callback function is 
not registered in cmd_struct in perf.c. So I think "perf iostat list" 
perhaps can not work properly.

I also test this patchset on x86 platform, and here is the log:

root@ubuntu:/home/lq# ./perf iostat list
perf: 'iostat' is not a perf-command. See 'perf --help'.
root@ubuntu:/home/lq# ./perf stat --iostat
^C
  Performance counter stats for 'system wide':

    port             Inbound Read(MB)    Inbound Write(MB)    Outbound 
Read(MB)   Outbound Write(MB)
0000:00                    0                    0                    0 
                  0
0000:80                    0                    0                    0 
                  0
0000:17                    0                    0                    0 
                  0
0000:85                    0                    0                    0 
                  0
0000:3a                    0                    0                    0 
                  0
0000:ae                    0                    0                    0 
                  0
0000:5d                    0                    0                    0 
                  0
0000:d7                    0                    0                    0 
                  0

        0.611303832 seconds time elapsed


root@ubuntu:/home/lq# ./perf stat --iostat=0000:17
^C
  Performance counter stats for 'system wide':

    port             Inbound Read(MB)    Inbound Write(MB)    Outbound 
Read(MB)   Outbound Write(MB)
0000:17                    0                    0                    0 
                  0

        0.521317572 seconds time elapsed

So how does following perf iostat list work, did I miss something?

Thanks,
Qi

> +
> +<ports>::
> +	Select the root ports for monitoring. Comma-separated list is supported.
> +
> +EXAMPLES
> +--------
> +
> +1. List all PCIe root ports (example for 2-S platform):
> +
> +   $ perf iostat list
> +   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>


  reply	other threads:[~2021-03-09  7:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 13:58 [PATCH v4 0/5] perf stat: Introduce iostat mode to provide I/O performance metrics Alexander Antonov
2021-02-03 13:58 ` [PATCH v4 1/5] perf stat: Add AGGR_PCIE_PORT mode Alexander Antonov
2021-02-04 12:07   ` Namhyung Kim
2021-02-08 11:30     ` Alexander Antonov
2021-02-10 10:02       ` Namhyung Kim
2021-02-03 13:58 ` [PATCH v4 2/5] perf stat: Basic support for iostat in perf Alexander Antonov
2021-02-04 12:22   ` Namhyung Kim
2021-02-08 11:55     ` Alexander Antonov
2021-02-10 10:07       ` Namhyung Kim
2021-02-03 13:58 ` [PATCH v4 3/5] perf stat: Helper functions for PCIe root ports list in iostat mode Alexander Antonov
2021-02-04 12:32   ` Namhyung Kim
2021-02-08 11:58     ` Alexander Antonov
2021-02-03 13:58 ` [PATCH v4 4/5] perf stat: Enable iostat mode for x86 platforms Alexander Antonov
2021-03-09  7:51   ` liuqi (BA) [this message]
2021-03-10 16:19     ` Alexander Antonov
2021-03-11  7:02       ` liuqi (BA)
2021-02-03 13:58 ` [PATCH v4 5/5] perf: Update .gitignore file Alexander Antonov
2021-02-03 20:55 ` [PATCH v4 0/5] perf stat: Introduce iostat mode to provide I/O performance metrics Arnaldo Carvalho de Melo
2021-02-04 12:35   ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2f23f76-3557-f6f1-dd0b-2491bb734b00@huawei.com \
    --to=liuqi115@huawei.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.antonov@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.