All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"Liang, Kan" <kan.liang@intel.com>
Subject: Re: [PATCH] perf record: enable multiplexing scaling via -R
Date: Fri, 1 Sep 2017 09:55:54 +0200	[thread overview]
Message-ID: <20170901075554.GC14815@krava> (raw)
In-Reply-To: <CABPqkBTreYD3Z4Su5DvOHMAf1fUP+KLCVbxBnUgQ19zPK4dNHw@mail.gmail.com>

On Wed, Aug 30, 2017 at 11:21:23PM -0700, Stephane Eranian wrote:

SNIP

> I am also surprised to see that perf record keep inherit=1 in
> system-wide mode. I don't think this
> is relavant in this mode. But the kernel this fails in this case,
> which I think is a bug. In system-wide
> mode, the attr-.no_inherit should be ignored. We can fix perf record
> to avoid this in system-wide.

agreed, how about attached patch

jirka


---
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 9bdea047c5db..e3cf1bd463f9 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -158,6 +158,7 @@ OPTIONS
 -a::
 --all-cpus::
         System-wide collection from all CPUs (default if no target is specified).
+	Disables inheritance of counters (forces --no-inherit option).
 
 -p::
 --pid=::
@@ -277,6 +278,7 @@ Collect samples only on the list of CPUs provided. Multiple CPUs can be provided
 comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
 In per-thread mode with inheritance mode on (default), samples are captured only when
 the thread executes on the designated CPUs. Default is to monitor all CPUs.
+Disables inheritance of counters (forces --no-inherit option).
 
 -B::
 --no-buildid::
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d9bd632ed7db..22308c42321d 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -850,7 +850,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
 	bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread;
 
 	attr->sample_id_all = perf_missing_features.sample_id_all ? 0 : 1;
-	attr->inherit	    = !opts->no_inherit;
+	attr->inherit	    = !opts->no_inherit && !target__has_cpu(&opts->target);
 	attr->write_backward = opts->overwrite ? 1 : 0;
 
 	perf_evsel__set_sample_bit(evsel, IP);

  reply	other threads:[~2017-09-01  7:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 19:14 [PATCH] perf record: enable multiplexing scaling via -R Stephane Eranian
2017-08-21 23:02 ` Andi Kleen
2017-08-22  0:13   ` Stephane Eranian
2017-08-22  1:25     ` Andi Kleen
2017-08-22  7:03       ` Jiri Olsa
2017-08-22  7:24         ` Stephane Eranian
2017-08-28 19:27           ` Stephane Eranian
2017-08-28 20:41             ` Andi Kleen
2017-08-31  6:21               ` Stephane Eranian
2017-09-01  7:55                 ` Jiri Olsa [this message]
2017-09-01  7:59                 ` Jiri Olsa
2017-09-01  8:21                   ` Stephane Eranian
2017-09-01  8:31                     ` Jiri Olsa

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=20170901075554.GC14815@krava \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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.