All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] riscv: Allow userspace to directly access perf counters
@ 2023-04-13 16:17 ` Alexandre Ghiti
  0 siblings, 0 replies; 76+ messages in thread
From: Alexandre Ghiti @ 2023-04-13 16:17 UTC (permalink / raw)
  To: Jonathan Corbet, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Ian Rogers, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Rob Herring, linux-doc, linux-kernel, linux-perf-users,
	linux-riscv, linux-arm-kernel
  Cc: Alexandre Ghiti

riscv used to allow direct access to cycle/time/instret counters,
bypassing the perf framework, this patchset intends to allow the user to
mmap any counter when accessed through perf. But we can't break the
existing behaviour so we introduce a sysctl perf_user_access like arm64
does, which defaults to the legacy mode described above.

The core of this patchset lies in patch 4, the first 3 patches are
simple fixes.

base-commit-tag: v6.3-rc1

Alexandre Ghiti (4):
  perf: Fix wrong comment about default event_idx
  include: riscv: Fix wrong include guard in riscv_pmu.h
  riscv: Make legacy counter enum match the HW numbering
  riscv: Enable perf counters user access only through perf

 Documentation/admin-guide/sysctl/kernel.rst |  23 +++-
 arch/riscv/include/asm/perf_event.h         |   3 +
 arch/riscv/kernel/Makefile                  |   2 +-
 arch/riscv/kernel/perf_event.c              |  65 +++++++++++
 drivers/perf/riscv_pmu.c                    |  42 ++++++++
 drivers/perf/riscv_pmu_legacy.c             |  24 ++++-
 drivers/perf/riscv_pmu_sbi.c                | 113 ++++++++++++++++++--
 include/linux/perf/riscv_pmu.h              |   9 +-
 include/linux/perf_event.h                  |   3 +-
 tools/lib/perf/mmap.c                       |  65 +++++++++++
 10 files changed, 332 insertions(+), 17 deletions(-)
 create mode 100644 arch/riscv/kernel/perf_event.c

-- 
2.37.2


^ permalink raw reply	[flat|nested] 76+ messages in thread

end of thread, other threads:[~2023-05-09 13:40 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 16:17 [PATCH 0/4] riscv: Allow userspace to directly access perf counters Alexandre Ghiti
2023-04-13 16:17 ` Alexandre Ghiti
2023-04-13 16:17 ` Alexandre Ghiti
2023-04-13 16:17 ` [PATCH 1/4] perf: Fix wrong comment about default event_idx Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17 ` [PATCH 2/4] include: riscv: Fix wrong include guard in riscv_pmu.h Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-18 18:26   ` Conor Dooley
2023-04-18 18:26     ` Conor Dooley
2023-04-18 18:26     ` Conor Dooley
2023-04-13 16:17 ` [PATCH 3/4] riscv: Make legacy counter enum match the HW numbering Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17 ` [PATCH 4/4] riscv: Enable perf counters user access only through perf Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 16:17   ` Alexandre Ghiti
2023-04-13 21:20   ` kernel test robot
2023-04-13 21:20     ` kernel test robot
2023-04-13 21:20     ` kernel test robot
2023-04-14  2:09   ` kernel test robot
2023-04-14  2:09     ` kernel test robot
2023-04-14  2:09     ` kernel test robot
2023-04-26 12:57   ` Andrew Jones
2023-04-26 12:57     ` Andrew Jones
2023-04-26 12:57     ` Andrew Jones
2023-04-26 13:17     ` Alexandre Ghiti
2023-04-26 13:17       ` Alexandre Ghiti
2023-04-26 13:17       ` Alexandre Ghiti
2023-04-26 13:25       ` Andrew Jones
2023-04-26 13:25         ` Andrew Jones
2023-04-26 13:25         ` Andrew Jones
2023-04-29  6:19         ` Atish Patra
2023-04-29  6:19           ` Atish Patra
2023-04-29  6:19           ` Atish Patra
2023-04-29  6:50           ` Atish Patra
2023-04-29  6:50             ` Atish Patra
2023-04-29  6:50             ` Atish Patra
2023-05-09 12:24       ` Emil Renner Berthing
2023-05-09 12:24         ` Emil Renner Berthing
2023-05-09 13:40         ` Alexandre Ghiti
2023-05-09 13:40           ` Alexandre Ghiti
2023-05-01  2:09   ` Bagas Sanjaya
2023-05-01  2:09     ` Bagas Sanjaya
2023-05-01  2:09     ` Bagas Sanjaya
2023-04-13 16:36 ` [PATCH 0/4] riscv: Allow userspace to directly access perf counters Ian Rogers
2023-04-13 16:36   ` Ian Rogers
2023-04-13 16:36   ` Ian Rogers
2023-04-13 19:17 ` Atish Patra
2023-04-13 19:17   ` Atish Patra
2023-04-13 19:17   ` Atish Patra
2023-04-13 21:10   ` David Laight
2023-04-13 21:10     ` David Laight
2023-04-13 21:10     ` David Laight
2023-04-18 16:43     ` Atish Patra
2023-04-18 16:43       ` Atish Patra
2023-04-18 16:43       ` Atish Patra
2023-04-18 18:15       ` Ian Rogers
2023-04-18 18:15         ` Ian Rogers
2023-04-18 18:15         ` Ian Rogers
2023-04-18 20:30         ` Atish Patra
2023-04-18 20:30           ` Atish Patra
2023-04-18 20:30           ` Atish Patra
2023-04-19  9:21           ` Alexandre Ghiti
2023-04-19  9:21             ` Alexandre Ghiti
2023-04-19  9:21             ` Alexandre Ghiti
2023-04-19 17:42             ` Ian Rogers
2023-04-19 17:42               ` Ian Rogers
2023-04-19 17:42               ` Ian Rogers
2023-04-19 23:21               ` Atish Patra
2023-04-19 23:21                 ` Atish Patra
2023-04-19 23:21                 ` Atish Patra
2023-04-20  0:31                 ` Ian Rogers
2023-04-20  0:31                   ` Ian Rogers
2023-04-20  0:31                   ` Ian Rogers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.