linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] arm64: perf: Proper cap_user_time* support
@ 2020-07-15  2:05 Leo Yan
  2020-07-15  2:05 ` [PATCH v2 1/6] sched_clock: Expose struct clock_read_data Leo Yan
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Leo Yan @ 2020-07-15  2:05 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Catalin Marinas, Thomas Gleixner, Paul Cercueil,
	Ben Dooks (Codethink),
	Ahmed S. Darwish, Adrian Hunter, Kan Liang, linux-arm-kernel,
	linux-kernel
  Cc: Leo Yan

This patch set is rebased for Peter's patch set to support
cap_user_time/cap_user_time_short ABI for Arm64, and export Arm arch
timer counter related parameters from kernel to Perf tool.

In this version, there have two changes comparing to Peter's original
patch set [1]:

The first change is for calculation 'time_zero', in the old patch it
used the formula:

  userpg->time_zero -= (rd->epoch_cyc * rd->mult) >> rd->shift;

From the testing, if 'rd->epoch_cyc' is a big counter value, then it's
easily to cause overflow issue when multiply by the 'rd->mult'.  So in
this patch set, it changes to use quot/rem approach for the calculation
and can avoid overflow:

  quot = rd->epoch_cyc >> rd->shift;
  rem = rd->epoch_cyc & (((u64)1 << rd->shift) - 1);
  ns = quot * rd->mult + ((rem * rd->mult) >> rd->shift);
  userpg->time_zero -= ns;

The second change is to add new patch 'tools headers UAPI: Update
tools's copy of linux/perf_event.h', it's used to update perf tool
header so make sure the headers are consistent between kernel and user
space.

This patch set has been rebased on mainline kernel with the latest
commit 11ba468877bb ("Linux 5.8-rc5"); it has been verified with Perf
tool for Arm SPE timestamp enabling, the patch set for Arm SPE timestamp
enabling will be sent out separately.


[1] https://lkml.org/lkml/2020/5/12/481


Leo Yan (1):
  tools headers UAPI: Update tools's copy of linux/perf_event.h

Peter Zijlstra (5):
  sched_clock: Expose struct clock_read_data
  arm64: perf: Implement correct cap_user_time
  arm64: perf: Only advertise cap_user_time for arch_timer
  perf: Add perf_event_mmap_page::cap_user_time_short ABI
  arm64: perf: Add cap_user_time_short

 arch/arm64/kernel/perf_event.c        | 59 ++++++++++++++++++++-------
 include/linux/sched_clock.h           | 28 +++++++++++++
 include/uapi/linux/perf_event.h       | 23 +++++++++--
 kernel/time/sched_clock.c             | 41 ++++++-------------
 tools/include/uapi/linux/perf_event.h | 23 +++++++++--
 5 files changed, 126 insertions(+), 48 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-07-15 15:41 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15  2:05 [PATCH v2 0/6] arm64: perf: Proper cap_user_time* support Leo Yan
2020-07-15  2:05 ` [PATCH v2 1/6] sched_clock: Expose struct clock_read_data Leo Yan
2020-07-15  5:56   ` Ahmed S. Darwish
2020-07-15  6:54     ` Leo Yan
2020-07-15  7:21       ` Ahmed S. Darwish
2020-07-15  8:12     ` Peter Zijlstra
2020-07-15  8:14       ` peterz
2020-07-15  9:23         ` Ahmed S. Darwish
2020-07-15  9:52           ` Peter Zijlstra
2020-07-15  2:05 ` [PATCH v2 2/6] arm64: perf: Implement correct cap_user_time Leo Yan
2020-07-15  8:38   ` Peter Zijlstra
2020-07-15 15:39     ` Leo Yan
2020-07-15  2:05 ` [PATCH v2 3/6] arm64: perf: Only advertise cap_user_time for arch_timer Leo Yan
2020-07-15  2:05 ` [PATCH v2 4/6] perf: Add perf_event_mmap_page::cap_user_time_short ABI Leo Yan
2020-07-15  2:05 ` [PATCH v2 5/6] arm64: perf: Add cap_user_time_short Leo Yan
2020-07-15  2:05 ` [PATCH v2 6/6] tools headers UAPI: Update tools's copy of linux/perf_event.h Leo Yan
2020-07-15  5:17 ` [PATCH v2 0/6] arm64: perf: Proper cap_user_time* support Ahmed S. Darwish
2020-07-15  6:29   ` Leo Yan

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).