From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755319AbdJITAG (ORCPT ); Mon, 9 Oct 2017 15:00:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754269AbdJITAE (ORCPT ); Mon, 9 Oct 2017 15:00:04 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 32B7481E0B Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=acme@redhat.com Date: Mon, 9 Oct 2017 16:00:00 -0300 From: Arnaldo Carvalho de Melo To: Will Deacon Cc: Mark Rutland , linux-kernel@vger.kernel.org, jolsa@kernel.org, stable@vger.kernel.org, Adrian Hunter , Borislav Petkov , David Ahern , Namhyung Kim , Peter Zijlstra Subject: Re: [PATCH] perf tools: unbreak perf record for arm/arm64 Message-ID: <20171009190000.GL2121@redhat.com> References: <1507315102-5942-1-git-send-email-mark.rutland@arm.com> <20171009102159.GA6882@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171009102159.GA6882@arm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 09 Oct 2017 19:00:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Oct 09, 2017 at 11:22:00AM +0100, Will Deacon escreveu: > On Fri, Oct 06, 2017 at 07:38:22PM +0100, Mark Rutland wrote: > > Currently, perf record is broken on arm/arm64 systems when the PMU is > > specified explicitly as part of the event, e.g. > > > > $ ./perf record -e armv8_cortex_a53/cpu_cycles/u true > > > > In such cases, perf record fails to open events unless > > perf_event_paranoid is set to -1, even if the PMU in question supports > > mode exclusion. Further, even when perf_event_paranoid is toggled, no > > samples are recorded. > > > > This is an unintended side effect of commit: > > > > e3ba76deef23064f ("perf tools: Force uncore events to system wide monitoring) > > > > ... which assumes that if a PMU has an associated cpu_map, it is an > > uncore PMU, and forces events for such PMUs to be system-wide. > > > > This is not true for arm/arm64 systems, which can have heterogeneous > > CPUs. To account for this, multiple CPU PMUs are exposed, each with a > > "cpus" field under sysfs, which the perf tool parses into a cpu_map. ARM > > PMUs do not have a "cpumask" file, and only have a "cpus" file. For the > > gory details as to why, see commit: > > > > 7e3fcffe95544010 ("perf pmu: Support alternative sysfs cpumask") > > > > Given all of this, we can instead identify uncore PMUs by explicitly > > checking for a "cpumask" file, and restore arm/arm64 PMU support back to > > a working state. This patch does so, adding a new perf_pmu::is_uncore > > field, and splitting the existing cpumask parsing so that it can be > > reused. > > > > Signed-off-by: Mark Rutland > > Fixes: e3ba76deef23064f ("perf tools: Force uncore events to system wide monitoring) > > It sucks that we haven't noticed this being broken for so long, but I can > confirm that this fixes the issue: > > Acked-by: Will Deacon > Tested-by Will Deacon > > Any chance we can get this into 4.14? You'll probably need to do some stable > backports too, since this is a bit spread out. Sure, I've added this to my perf/urgent branch, that, together with a few other fixes is undergoing testing now. - Arnaldo