linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Like Xu <like.xu.linux@gmail.com>
Cc: Ian Rogers <irogers@google.com>,
	Alexander Antonov <alexander.antonov@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephane Eranian <eranian@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] perf iostat: Use system-wide mode if the target cpu_list is unspecified
Date: Mon, 27 Sep 2021 09:40:18 -0300	[thread overview]
Message-ID: <YVG7spSrPm/oJW8W@kernel.org> (raw)
In-Reply-To: <20210927081115.39568-1-likexu@tencent.com>

Em Mon, Sep 27, 2021 at 04:11:14PM +0800, Like Xu escreveu:
> From: Like Xu <likexu@tencent.com>
> 
> An iostate use case like "perf iostat 0000:16,0000:97 -- ls" should be
> implemented to work in system-wide mode to ensure that the output from
> print_header() is consistent with the user documentation perf-iostat.txt,
> rather than incorrectly assuming that the kernel does not support it:
> 
>  Error:
>  The sys_perf_event_open() syscall returned with 22 (Invalid argument) \
>  for event (uncore_iio_0/event=0x83,umask=0x04,ch_mask=0xF,fc_mask=0x07/).
>  /bin/dmesg | grep -i perf may provide additional information.
> 
> This error is easily fixed by assigning system-wide mode by default
> for IOSTAT_RUN only when the target cpu_list is unspecified.

Looks ok, added:

Fixes: f07952b179697771 ("perf stat: Basic support for iostat in perf")

For stable@vger.kernel.org sake.

- Arnaldo
 
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
>  tools/perf/builtin-stat.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index f6e87b7be5fa..f0ecfda34ece 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -2408,6 +2408,8 @@ int cmd_stat(int argc, const char **argv)
>  			goto out;
>  		} else if (verbose)
>  			iostat_list(evsel_list, &stat_config);
> +		if (iostat_mode == IOSTAT_RUN && !target__has_cpu(&target))
> +			target.system_wide = true;
>  	}
>  
>  	if (add_default_attributes())
> -- 
> 2.32.0

-- 

- Arnaldo

  parent reply	other threads:[~2021-09-27 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27  8:11 [PATCH 1/2] perf iostat: Use system-wide mode if the target cpu_list is unspecified Like Xu
2021-09-27  8:11 ` [PATCH 2/2] perf iostat: Fix Segmentation fault from NULL 'struct perf_counts_values *' Like Xu
2021-09-27 12:42   ` Arnaldo Carvalho de Melo
2021-09-27 12:40 ` Arnaldo Carvalho de Melo [this message]
2021-09-28  9:06 ` [PATCH 1/2] perf iostat: Use system-wide mode if the target cpu_list is unspecified Alexander Antonov

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=YVG7spSrPm/oJW8W@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.antonov@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=like.xu.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).