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

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