History

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.

Will Deacon committed 5 years ago

Commit 245a0571 parent ea5c7f13 files · +17 −1Browse files

Unified · Split

3 files
  1. kernel/time/tick-broadcast.c +7 −0
  2. kernel/time/tick-internal.h +1 −0
  3. kernel/time/timer_list.c +9 −1
kernel/time/tick-broadcast.c+7−0
@@ -63,6 +63,13 @@ struct cpumask *tick_get_broadcast_mask(void) · 62 unmodified lines
6363 return tick_broadcast_mask;
6464 }
6565
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+
6673 /*
6774 * Start the device in periodic mode
6875 */
kernel/time/tick-internal.h+1−0
@@ -71,6 +71,7 @@ extern void tick_set_periodic_handler(struct clock_event_device *dev, int broadc · 70 unmodified lines
7171 extern int tick_broadcast_update_freq(struct clock_event_device *dev, u32 freq);
7272 extern struct tick_device *tick_get_broadcast_device(void);
7373 extern struct cpumask *tick_get_broadcast_mask(void);
74+extern const struct clock_event_device *tick_get_wakeup_device(int cpu);
7475 # else /* !CONFIG_GENERIC_CLOCKEVENTS_BROADCAST: */
7576 static inline void tick_install_broadcast_device(struct clock_event_device *dev, int cpu) { }
7677 static inline int tick_is_broadcast_device(struct clock_event_device *dev) { return 0; }
kernel/time/timer_list.c+9−1
@@ -228,6 +228,14 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) · 227 unmodified lines
228228 SEQ_printf(m, " event_handler: %ps\n", dev->event_handler);
229229 SEQ_printf(m, "\n");
230230 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
231239 SEQ_printf(m, "\n");
232240 }
233241
@@ -248,7 +256,7 @@ static void timer_list_show_tickdevices_header(struct seq_file *m) · 14 unmodified lines
248256
249257 static inline void timer_list_header(struct seq_file *m, u64 now)
250258 {
251− SEQ_printf(m, "Timer List Version: v0.8\n");
259+ SEQ_printf(m, "Timer List Version: v0.9\n");
252260 SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
253261 SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
254262 SEQ_printf(m, "\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t