From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org, jolsa@kernel.org,
stable@vger.kernel.org, Adrian Hunter <adrian.hunter@intel.com>,
Borislav Petkov <bp@alien8.de>, David Ahern <dsahern@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] perf tools: unbreak perf record for arm/arm64
Date: Mon, 9 Oct 2017 16:00:00 -0300 [thread overview]
Message-ID: <20171009190000.GL2121@redhat.com> (raw)
In-Reply-To: <20171009102159.GA6882@arm.com>
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 <mark.rutland@arm.com>
> > 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 <will.deacon@arm.com>
> Tested-by Will Deacon <will.deacon@arm.com>
>
> 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
next prev parent reply other threads:[~2017-10-09 19:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 18:38 [PATCH] perf tools: unbreak perf record for arm/arm64 Mark Rutland
2017-10-09 9:38 ` Jiri Olsa
2017-10-09 10:22 ` Will Deacon
2017-10-09 10:51 ` Mark Rutland
2017-10-09 19:00 ` Arnaldo Carvalho de Melo [this message]
2017-10-09 19:02 ` Will Deacon
2017-10-10 17:28 ` [tip:perf/urgent] perf pmu: Unbreak perf record for arm/arm64 with events with explicit PMU tip-bot for Mark Rutland
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=20171009190000.GL2121@redhat.com \
--to=acme@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=adrian.hunter@intel.com \
--cc=bp@alien8.de \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=namhyung@kernel.org \
--cc=stable@vger.kernel.org \
--cc=will.deacon@arm.com \
/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