Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751503AbdIAH4A (ORCPT ); Fri, 1 Sep 2017 03:56:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50954 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbdIAHz6 (ORCPT ); Fri, 1 Sep 2017 03:55:58 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8D27A267C6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Fri, 1 Sep 2017 09:55:54 +0200 From: Jiri Olsa To: Stephane Eranian Cc: Andi Kleen , LKML , Arnaldo Carvalho de Melo , Peter Zijlstra , "mingo@elte.hu" , "Liang, Kan" Subject: Re: [PATCH] perf record: enable multiplexing scaling via -R Message-ID: <20170901075554.GC14815@krava> References: <1503342849-2036-1-git-send-email-eranian@google.com> <87wp5wr0cb.fsf@firstfloor.org> <20170822012545.GJ2482@two.firstfloor.org> <20170822070332.GA21829@krava> <20170828204114.GR2482@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 01 Sep 2017 07:55:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1932 Lines: 50 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);