[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240830232910.1839548-1-namhyung@kernel.org>
Date: Fri, 30 Aug 2024 16:29:06 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Kan Liang <kan.liang@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Ravi Bangoria <ravi.bangoria@....com>
Subject: [RFC/PATCH 0/4] perf: Relax privilege restriction on AMD IBS (v2)
Hello,
This is RFC v2 to allow AMD IBS to regular users on the default settings
where kernel-level profiling is disabled. Currently AMD IBS doesn't
allow any kind of exclusion in the event attribute. But users needs to
set attr.exclude_kernel to open an event on such an environment.
v2) changes
* add PERF_FORMAT_DROPPED
* account dropped sw events and from BPF handler
* use precise RIP from IBS record
v1) https://lore.kernel.org/lkml/20240822230816.564262-1-namhyung@kernel.org/
While IBS doesn't support hardware level privilege filters, the kernel
can allow the event and drop samples belongs to the kernel like in the
software events.
In order to count those dropped samples correctly, I'd propose a new
read format PERF_FORMAT_DROPPED same as we did for the lost samples.
With this, it can count dropped samples in the software events and
from the BPF overflow handler as well.
Let me know what you think.
Thanks,
Namhyung
Namhyung Kim (4):
perf/core: Add PERF_FORMAT_DROPPED
perf/core: Export perf_exclude_event()
perf/core: Account dropped samples from BPF
perf/x86: Relax privilege filter restriction on AMD IBS
arch/x86/events/amd/ibs.c | 13 +++++++++++--
include/linux/perf_event.h | 3 +++
include/uapi/linux/perf_event.h | 5 ++++-
kernel/events/core.c | 27 ++++++++++++++++++++++-----
4 files changed, 40 insertions(+), 8 deletions(-)
--
2.46.0.469.g59c65b2a67-goog
Powered by blists - more mailing lists