Sample the latency of memory accesses in dirty_log_perf_test and report summary stats to give a picture of the latency distribution. Specifically, focus on the right tail with the 50th, 90th, and 99th percentile reported in ns. v2: * rebase to v6.3-rc2 * move counter measurement to common code helpers * fix page allocation math for only the exact number needed * add command line argument to control number of samples v1: https://lore.kernel.org/kvm/20221115173258.2530923-1-coltonlewis@xxxxxxxxxx/ Colton Lewis (2): KVM: selftests: Provide generic way to read system counter KVM: selftests: Print summary stats of memory latency distribution .../selftests/kvm/access_tracking_perf_test.c | 3 +- .../selftests/kvm/demand_paging_test.c | 2 +- .../selftests/kvm/dirty_log_perf_test.c | 10 ++- .../testing/selftests/kvm/include/kvm_util.h | 15 ++++ .../testing/selftests/kvm/include/memstress.h | 10 ++- tools/testing/selftests/kvm/lib/kvm_util.c | 30 ++++++++ tools/testing/selftests/kvm/lib/memstress.c | 68 ++++++++++++++++--- .../kvm/memslot_modification_stress_test.c | 2 +- .../kvm/system_counter_offset_test.c | 10 +-- 9 files changed, 128 insertions(+), 22 deletions(-) -- 2.40.0.rc1.284.g88254d51c5-goog