Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

timer_list: Print name of per-cpu wakeup device

With the introduction of per-cpu wakeup devices that can be used in
preference to the broadcast timer, print the name of such devices when
they are available.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-6-will@kernel.org

authored by

Will Deacon and committed by
Thomas Gleixner
245a057f ea5c7f1b

+17 -1
+7
kernel/time/tick-broadcast.c
··· 63 63 return tick_broadcast_mask; 64 64 } 65 65 66 + static struct clock_event_device *tick_get_oneshot_wakeup_device(int cpu); 67 + 68 + const struct clock_event_device *tick_get_wakeup_device(int cpu) 69 + { 70 + return tick_get_oneshot_wakeup_device(cpu); 71 + } 72 + 66 73 /* 67 74 * Start the device in periodic mode 68 75 */
+1
kernel/time/tick-internal.h
··· 71 71 extern int tick_broadcast_update_freq(struct clock_event_device *dev, u32 freq); 72 72 extern struct tick_device *tick_get_broadcast_device(void); 73 73 extern struct cpumask *tick_get_broadcast_mask(void); 74 + extern const struct clock_event_device *tick_get_wakeup_device(int cpu); 74 75 # else /* !CONFIG_GENERIC_CLOCKEVENTS_BROADCAST: */ 75 76 static inline void tick_install_broadcast_device(struct clock_event_device *dev, int cpu) { } 76 77 static inline int tick_is_broadcast_device(struct clock_event_device *dev) { return 0; }
+9 -1
kernel/time/timer_list.c
··· 228 228 SEQ_printf(m, " event_handler: %ps\n", dev->event_handler); 229 229 SEQ_printf(m, "\n"); 230 230 SEQ_printf(m, " retries: %lu\n", dev->retries); 231 + 232 + #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 233 + if (cpu >= 0) { 234 + const struct clock_event_device *wd = tick_get_wakeup_device(cpu); 235 + 236 + SEQ_printf(m, "Wakeup Device: %s\n", wd ? wd->name : "<NULL>"); 237 + } 238 + #endif 231 239 SEQ_printf(m, "\n"); 232 240 } 233 241 ··· 256 248 257 249 static inline void timer_list_header(struct seq_file *m, u64 now) 258 250 { 259 - SEQ_printf(m, "Timer List Version: v0.8\n"); 251 + SEQ_printf(m, "Timer List Version: v0.9\n"); 260 252 SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES); 261 253 SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now); 262 254 SEQ_printf(m, "\n");