mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 0/3] timer_list: make debug output more useful
@ 2008-09-30 18:44 Thomas Gleixner
  2008-09-30 18:44 ` [patch 1/3] timer_list: print real timer address Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Gleixner @ 2008-09-30 18:44 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Arjan van de Veen

/proc/timer_list resp. sysrq-Q is an important debug helper to analyse
timer related problems. Make it more useful.

Thanks,

	tglx




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 1/3] timer_list: print real timer address
  2008-09-30 18:44 [patch 0/3] timer_list: make debug output more useful Thomas Gleixner
@ 2008-09-30 18:44 ` Thomas Gleixner
  2008-09-30 18:44 ` [patch 2/3] timer_list: print cpu number of clockevents device Thomas Gleixner
  2008-09-30 18:44 ` [patch 3/3] timer_list: add base address to clock base Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2008-09-30 18:44 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Arjan van de Veen

[-- Attachment #1: timerlist-make-output-useful.patch --]
[-- Type: text/plain, Size: 1262 bytes --]

The current timer_list output prints the address of the on stack copy
of the active hrtimer instead of the hrtimer itself.

Print the address of the real timer instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/timer_list.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6-tip/kernel/time/timer_list.c
===================================================================
--- linux-2.6-tip.orig/kernel/time/timer_list.c
+++ linux-2.6-tip/kernel/time/timer_list.c
@@ -47,13 +47,14 @@ static void print_name_offset(struct seq
 }
 
 static void
-print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now)
+print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer,
+	    int idx, u64 now)
 {
 #ifdef CONFIG_TIMER_STATS
 	char tmp[TASK_COMM_LEN + 1];
 #endif
 	SEQ_printf(m, " #%d: ", idx);
-	print_name_offset(m, timer);
+	print_name_offset(m, taddr);
 	SEQ_printf(m, ", ");
 	print_name_offset(m, timer->function);
 	SEQ_printf(m, ", S:%02lx", timer->state);
@@ -99,7 +100,7 @@ next_one:
 		tmp = *timer;
 		spin_unlock_irqrestore(&base->cpu_base->lock, flags);
 
-		print_timer(m, &tmp, i, now);
+		print_timer(m, timer, &tmp, i, now);
 		next++;
 		goto next_one;
 	}



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 2/3] timer_list: print cpu number of clockevents device
  2008-09-30 18:44 [patch 0/3] timer_list: make debug output more useful Thomas Gleixner
  2008-09-30 18:44 ` [patch 1/3] timer_list: print real timer address Thomas Gleixner
@ 2008-09-30 18:44 ` Thomas Gleixner
  2008-09-30 18:44 ` [patch 3/3] timer_list: add base address to clock base Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2008-09-30 18:44 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Arjan van de Veen

[-- Attachment #1: timerlist-print-cpu-number-of-clockevents-device.patch --]
[-- Type: text/plain, Size: 1773 bytes --]

The per cpu clock events device output of timer_list lacks an
association of the device to the cpu which is annoying when looking at
the output of /proc/timer_list from a 128 way system. 

Add the CPU number info and mark the broadcast device in the device
list printout.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/timer_list.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Index: linux-2.6-tip/kernel/time/timer_list.c
===================================================================
--- linux-2.6-tip.orig/kernel/time/timer_list.c
+++ linux-2.6-tip/kernel/time/timer_list.c
@@ -184,12 +184,16 @@ static void print_cpu(struct seq_file *m
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 static void
-print_tickdevice(struct seq_file *m, struct tick_device *td)
+print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
 {
 	struct clock_event_device *dev = td->evtdev;
 
 	SEQ_printf(m, "\n");
 	SEQ_printf(m, "Tick Device: mode:     %d\n", td->mode);
+	if (cpu < 0)
+		SEQ_printf(m, "Broadcast device\n");
+	else
+		SEQ_printf(m, "Per CPU device: %d\n", cpu);
 
 	SEQ_printf(m, "Clock Event Device: ");
 	if (!dev) {
@@ -223,7 +227,7 @@ static void timer_list_show_tickdevices(
 	int cpu;
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
-	print_tickdevice(m, tick_get_broadcast_device());
+	print_tickdevice(m, tick_get_broadcast_device(), -1);
 	SEQ_printf(m, "tick_broadcast_mask: %08lx\n",
 		   tick_get_broadcast_mask()->bits[0]);
 #ifdef CONFIG_TICK_ONESHOT
@@ -233,7 +237,7 @@ static void timer_list_show_tickdevices(
 	SEQ_printf(m, "\n");
 #endif
 	for_each_online_cpu(cpu)
-		   print_tickdevice(m, tick_get_device(cpu));
+		print_tickdevice(m, tick_get_device(cpu), cpu);
 	SEQ_printf(m, "\n");
 }
 #else



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 3/3] timer_list: add base address to clock base
  2008-09-30 18:44 [patch 0/3] timer_list: make debug output more useful Thomas Gleixner
  2008-09-30 18:44 ` [patch 1/3] timer_list: print real timer address Thomas Gleixner
  2008-09-30 18:44 ` [patch 2/3] timer_list: print cpu number of clockevents device Thomas Gleixner
@ 2008-09-30 18:44 ` Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2008-09-30 18:44 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Arjan van de Veen

[-- Attachment #1: timerlist-add-base-address-to-clock-base.patch --]
[-- Type: text/plain, Size: 1084 bytes --]

The base address of a (per cpu) clock base is a useful debug info.
Add it and bump the version number of timer_lists.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/timer_list.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/kernel/time/timer_list.c
===================================================================
--- linux-2.6-tip.orig/kernel/time/timer_list.c
+++ linux-2.6-tip/kernel/time/timer_list.c
@@ -110,6 +110,7 @@ next_one:
 static void
 print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now)
 {
+	SEQ_printf(m, "  .base:       %p\n", base);
 	SEQ_printf(m, "  .index:      %d\n",
 			base->index);
 	SEQ_printf(m, "  .resolution: %Lu nsecs\n",
@@ -249,7 +250,7 @@ static int timer_list_show(struct seq_fi
 	u64 now = ktime_to_ns(ktime_get());
 	int cpu;
 
-	SEQ_printf(m, "Timer List Version: v0.3\n");
+	SEQ_printf(m, "Timer List Version: v0.4\n");
 	SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
 	SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-30 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-30 18:44 [patch 0/3] timer_list: make debug output more useful Thomas Gleixner
2008-09-30 18:44 ` [patch 1/3] timer_list: print real timer address Thomas Gleixner
2008-09-30 18:44 ` [patch 2/3] timer_list: print cpu number of clockevents device Thomas Gleixner
2008-09-30 18:44 ` [patch 3/3] timer_list: add base address to clock base Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®