Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1724857

Re: [PATCH] perf record: enable multiplexing scaling via -R

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf record: enable multiplexing scaling via -R
Date 2017-09-01 10:00 +0200
Message-ID <ukP1W-TX-35@gated-at.bofh.it> (permalink)
References (4 earlier) <uhbu1-7on-1@gated-at.bofh.it> <uhbNn-7yL-5@gated-at.bofh.it> <ujxTs-16C-39@gated-at.bofh.it> <ujz8S-1KT-21@gated-at.bofh.it> <ukr9g-24P-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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);

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] perf record: enable multiplexing scaling via -R Stephane Eranian <eranian@google.com> - 2017-08-28 21:30 +0200
  Re: [PATCH] perf record: enable multiplexing scaling via -R Andi Kleen <andi@firstfloor.org> - 2017-08-28 22:50 +0200
    Re: [PATCH] perf record: enable multiplexing scaling via -R Stephane Eranian <eranian@google.com> - 2017-08-31 08:30 +0200
      Re: [PATCH] perf record: enable multiplexing scaling via -R Jiri Olsa <jolsa@redhat.com> - 2017-09-01 10:00 +0200
        Re: [PATCH] perf record: enable multiplexing scaling via -R Stephane Eranian <eranian@google.com> - 2017-09-01 10:30 +0200
          Re: [PATCH] perf record: enable multiplexing scaling via -R Jiri Olsa <jolsa@redhat.com> - 2017-09-01 10:40 +0200
      Re: [PATCH] perf record: enable multiplexing scaling via -R Jiri Olsa <jolsa@redhat.com> - 2017-09-01 10:00 +0200

csiph-web