Blame SOURCES/0003-Fix-for-timer-r-option-to-display-all-the-per-CPU-cl.patch

412566
From c48177972f351d7853abb2a57709628c75ee38bc Mon Sep 17 00:00:00 2001
412566
From: Lianbo Jiang <lijiang@redhat.com>
412566
Date: Thu, 6 Jan 2022 22:34:26 +0800
412566
Subject: [PATCH 03/11] Fix for "timer -r" option to display all the per-CPU
412566
 clocks
412566
412566
Currently, the hrtimer_max_clock_bases is hard-coded to 3, which
412566
makes that crash only prints three clocks, and the rest of clocks
412566
are not displayed.
412566
412566
Without the patch:
412566
crash> timer -r -C 11
412566
CPU: 11  HRTIMER_CPU_BASE: ffff9a775f95ee00
412566
  CLOCK: 0  HRTIMER_CLOCK_BASE: ffff9a775f95ee80  [ktime_get]
412566
  (empty)
412566
412566
  CLOCK: 1  HRTIMER_CLOCK_BASE: ffff9a775f95ef00  [ktime_get_real]
412566
  (empty)
412566
412566
  CLOCK: 2  HRTIMER_CLOCK_BASE: ffff9a775f95ef80  [ktime_get_boottime]
412566
  (empty)
412566
412566
With the patch:
412566
crash> timer -r -C 11
412566
CPU: 11  HRTIMER_CPU_BASE: ffff9a775f95ee00
412566
  CLOCK: 0  HRTIMER_CLOCK_BASE: ffff9a775f95ee80  [ktime_get]
412566
  (empty)
412566
412566
  CLOCK: 1  HRTIMER_CLOCK_BASE: ffff9a775f95ef00  [ktime_get_real]
412566
  (empty)
412566
412566
  CLOCK: 2  HRTIMER_CLOCK_BASE: ffff9a775f95ef80  [ktime_get_boottime]
412566
  (empty)
412566
...
412566
  CLOCK: 7  HRTIMER_CLOCK_BASE: ffff9a775f95f200  [ktime_get_clocktai]
412566
  (empty)
412566
412566
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
412566
---
412566
 kernel.c | 3 ++-
412566
 1 file changed, 2 insertions(+), 1 deletion(-)
412566
412566
diff --git a/kernel.c b/kernel.c
412566
index a637dd0eb8f8..a44a9c52ace0 100644
412566
--- a/kernel.c
412566
+++ b/kernel.c
412566
@@ -7672,7 +7672,8 @@ dump_hrtimer_data(const ulong *cpus)
412566
 	if (VALID_STRUCT(hrtimer_clock_base)) {
412566
 		hrtimer_max_clock_bases = 2;
412566
 		if (symbol_exists("ktime_get_boottime"))
412566
-			hrtimer_max_clock_bases = 3;
412566
+			hrtimer_max_clock_bases = MEMBER_SIZE("hrtimer_cpu_base", "clock_base") /
412566
+							SIZE(hrtimer_clock_base);
412566
 	} else if (VALID_STRUCT(hrtimer_base)) {
412566
 		max_hrtimer_bases = 2;
412566
 	} else
412566
-- 
412566
2.20.1
412566