Skip to content

Commit 60cf7ea

Browse files
Nathan ZimmerKAGA-KOKO
authored andcommitted
timer_list: Split timer_list_show_tickdevices
Split timer_list_show_tickdevices() into the header printout and pull the rest up to timer_list_show. This is a preparatory patch for converting timer_list to a proper seqfile with its own iterator Signed-off-by: Nathan Zimmer <nzimmer@sgi.com> Reported-by: Dave Jones <davej@redhat.com> Cc: John Stultz <johnstul@us.ibm.com> Cc: Stephen Boyd <sboyd@codeaurora.org> Link: http://lkml.kernel.org/r/1364345790-14577-2-git-send-email-nzimmer@sgi.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 57b8015 commit 60cf7ea

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

‎kernel/time/timer_list.c‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
133133
struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
134134
int i;
135135

136-
SEQ_printf(m, "\n");
137136
SEQ_printf(m, "cpu: %d\n", cpu);
138137
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
139138
SEQ_printf(m, " clock %d:\n", i);
@@ -187,6 +186,7 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
187186

188187
#undef P
189188
#undef P_ns
189+
SEQ_printf(m, "\n");
190190
}
191191

192192
#ifdef CONFIG_GENERIC_CLOCKEVENTS
@@ -195,7 +195,6 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
195195
{
196196
struct clock_event_device *dev = td->evtdev;
197197

198-
SEQ_printf(m, "\n");
199198
SEQ_printf(m, "Tick Device: mode: %d\n", td->mode);
200199
if (cpu < 0)
201200
SEQ_printf(m, "Broadcast device\n");
@@ -230,12 +229,11 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
230229
print_name_offset(m, dev->event_handler);
231230
SEQ_printf(m, "\n");
232231
SEQ_printf(m, " retries: %lu\n", dev->retries);
232+
SEQ_printf(m, "\n");
233233
}
234234

235-
static void timer_list_show_tickdevices(struct seq_file *m)
235+
static void timer_list_show_tickdevices_header(struct seq_file *m)
236236
{
237-
int cpu;
238-
239237
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
240238
print_tickdevice(m, tick_get_broadcast_device(), -1);
241239
SEQ_printf(m, "tick_broadcast_mask: %08lx\n",
@@ -246,12 +244,7 @@ static void timer_list_show_tickdevices(struct seq_file *m)
246244
#endif
247245
SEQ_printf(m, "\n");
248246
#endif
249-
for_each_online_cpu(cpu)
250-
print_tickdevice(m, tick_get_device(cpu), cpu);
251-
SEQ_printf(m, "\n");
252247
}
253-
#else
254-
static void timer_list_show_tickdevices(struct seq_file *m) { }
255248
#endif
256249

257250
static int timer_list_show(struct seq_file *m, void *v)
@@ -262,12 +255,16 @@ static int timer_list_show(struct seq_file *m, void *v)
262255
SEQ_printf(m, "Timer List Version: v0.7\n");
263256
SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
264257
SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
258+
SEQ_printf(m, "\n");
265259

266260
for_each_online_cpu(cpu)
267261
print_cpu(m, cpu, now);
268262

269-
SEQ_printf(m, "\n");
270-
timer_list_show_tickdevices(m);
263+
#ifdef CONFIG_GENERIC_CLOCKEVENTS
264+
timer_list_show_tickdevices_header(m);
265+
for_each_online_cpu(cpu)
266+
print_tickdevice(m, tick_get_device(cpu), cpu);
267+
#endif
271268

272269
return 0;
273270
}

0 commit comments

Comments
 (0)