mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Regarding perfmon_capable()
Date: Fri, 1 Jul 2022 10:37:37 +0530	[thread overview]
Message-ID: <9be223fb-5803-b676-902a-28e1c168cd8a@arm.com> (raw)

Hello,

In perf event subsystem and related platform drivers registering a PMU,
should perfmon_capable() be used directly ? OR just wondering if instead
perf_allow_[cpu|kernel|tracepoint]() helpers should be used which also
checks for 'sysctl_perf_event_paranoid' ? Should not both capabilities
and 'sysctl_perf_event_paranoid' decide whether kernel/cpu/tracepoint
events will be captured for unprivileged users.

arch/parisc/kernel/perf.c:      if (!perfmon_capable())
arch/powerpc/perf/imc-pmu.c:    if (!perfmon_capable())
arch/powerpc/perf/imc-pmu.c:    if (!perfmon_capable())
drivers/gpu/drm/i915/i915_perf.c:           i915_perf_stream_paranoid && !perfmon_capable()) {
drivers/gpu/drm/i915/i915_perf.c:                       if (oa_freq_hz > i915_oa_max_sample_rate && !perfmon_capable()) {
drivers/gpu/drm/i915/i915_perf.c:       if (i915_perf_stream_paranoid && !perfmon_capable()) {
drivers/gpu/drm/i915/i915_perf.c:       if (i915_perf_stream_paranoid && !perfmon_capable()) {
drivers/media/rc/bpf-lirc.c:            if (perfmon_capable())
drivers/perf/arm_spe_pmu.c:     if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && perfmon_capable())
drivers/perf/arm_spe_pmu.c:     if (!perfmon_capable() &&

Although BPF might use perfmon_capabale() alone, because it was never
dependent on 'sysctl_perf_event_paranoid' ?

- Anshuman

             reply	other threads:[~2022-07-01  5:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01  5:07 Anshuman Khandual [this message]
2022-07-01  6:47 ` Leo Yan
2022-07-01  7:22   ` Anshuman Khandual
2022-07-01  8:50     ` Leo Yan

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=9be223fb-5803-b676-902a-28e1c168cd8a@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®