From: Peter Zijlstra <peterz@infradead.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org,
will.deacon@arm.com
Subject: Re: [PATCH v2] perf: Fix exclusive events' grouping
Date: Mon, 1 Jul 2019 16:28:03 +0200 [thread overview]
Message-ID: <20190701142803.GA3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190701110755.24646-1-alexander.shishkin@linux.intel.com>
On Mon, Jul 01, 2019 at 02:07:55PM +0300, Alexander Shishkin wrote:
> So far, we tried to disallow grouping exclusive events for the fear of
> complications they would cause with moving between contexts. Specifically,
> moving a software group to a hardware context would violate the exclusivity
> rules if both groups contain matching exclusive events.
>
> This attempt was, however, unsuccessful: the check that we have in the
> perf_event_open() syscall is both wrong (looks at wrong PMU) and
> insufficient (group leader may still be exclusive), as can be illustrated
> by running
>
> $ perf record -e '{intel_pt//,cycles}' uname
> $ perf record -e '{cycles,intel_pt//}' uname
>
> ultimately successfully.
>
> Furthermore, we are completely free to trigger the exclusivity violation
> by -e '{cycles,intel_pt//}' -e '{intel_pt//,instructions}', even though
> the helpful perf record will not allow that, the ABI will. The warning
> later in the perf_event_open() path will also not trigger, because it's
> also wrong.
>
> Fix all this by validating the original group before moving, getting rid
> of broken safeguards and placing a useful one to perf_install_in_context().
>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Fixes: bed5b25ad9c8a ("perf: Add a pmu capability for "exclusive" events")
Thanks!
next prev parent reply other threads:[~2019-07-01 14:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 11:07 [PATCH v2] perf: Fix exclusive events' grouping Alexander Shishkin
2019-07-01 14:28 ` Peter Zijlstra [this message]
2019-07-13 11:12 ` [tip:perf/urgent] perf/core: " tip-bot for Alexander Shishkin
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=20190701142803.GA3402@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).