linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] libperf: Unify scaling of counters obtained from perf_evsel__read()
@ 2021-11-09  8:58 Shunsuke Nakamura
  2021-11-09  8:58 ` [PATCH v3 1/3] libperf: Move perf_counts_values__scale to tools/lib/perf Shunsuke Nakamura
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Shunsuke Nakamura @ 2021-11-09  8:58 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, robh
  Cc: linux-kernel, linux-perf-users

This patch series unifies the counters that can be obtained from
perf_evsel__read() to "no scaling".
The counter scaling will be done using a function moved from
tools/perf/util.

The first patch move perf_counts_values__scale from tools/perf/util
to tools/lib/perf so that it can be used with libperf.

The second patch removes the scaling process from
perf_mmap__read_self().

The third patch adds a verification test to make sure that it scales
correctly when multiplexed.

---
Previous version at:
https://lore.kernel.org/linux-perf-users/20210922101627.3396398-1-nakamura.shun@fujitsu.com/

Changes in v3:
 - Move scaling process from tools/perf/util to tools/lib/perf
 - Remove scaling process from perf_mmap__read_self()
 - Remove scaling process for perf_mmap__read_self
 - Remove test to verify that no division by zero occurs

Changes in v2:
 - Fix not to divide by zero when counter scaling
 - Add test to verify that no division by zero occurs


[1] https://github.com/deater/perf_event_tests/blob/master/tests/rdpmc/rdpmc_multiplexing.c


Shunsuke Nakamura (3):
  libperf: Move perf_counts_values__scale to tools/lib/perf
  libperf: Remove scaling process from perf_mmap__read_self()
  libperf tests: Add test_stat_multiplexing test

 tools/lib/perf/evsel.c              |  19 ++++
 tools/lib/perf/include/perf/evsel.h |   4 +
 tools/lib/perf/libperf.map          |   1 +
 tools/lib/perf/mmap.c               |   2 -
 tools/lib/perf/tests/test-evlist.c  | 157 ++++++++++++++++++++++++++++
 tools/perf/util/evsel.c             |  19 ----
 tools/perf/util/evsel.h             |   3 -
 7 files changed, 181 insertions(+), 24 deletions(-)

-- 
2.27.0


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

end of thread, other threads:[~2021-11-29  8:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09  8:58 [PATCH v3 0/3] libperf: Unify scaling of counters obtained from perf_evsel__read() Shunsuke Nakamura
2021-11-09  8:58 ` [PATCH v3 1/3] libperf: Move perf_counts_values__scale to tools/lib/perf Shunsuke Nakamura
2021-11-14 16:19   ` Jiri Olsa
2021-11-17 14:57     ` Arnaldo Carvalho de Melo
2021-11-29  7:59       ` nakamura.shun
2021-11-09  8:58 ` [PATCH v3 2/3] libperf: Remove scaling process from perf_mmap__read_self() Shunsuke Nakamura
2021-11-09  8:58 ` [PATCH v3 3/3] libperf tests: Add test_stat_multiplexing test Shunsuke Nakamura

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