diff options
Diffstat (limited to 'kernel/time/timer_list.c')
| -rw-r--r-- | kernel/time/timer_list.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index a40e20fd000..a999b92a127 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
| @@ -47,13 +47,14 @@ static void print_name_offset(struct seq_file *m, void *sym) | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | static void | 49 | static void |
| 50 | print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now) | 50 | print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer, |
| 51 | int idx, u64 now) | ||
| 51 | { | 52 | { |
| 52 | #ifdef CONFIG_TIMER_STATS | 53 | #ifdef CONFIG_TIMER_STATS |
| 53 | char tmp[TASK_COMM_LEN + 1]; | 54 | char tmp[TASK_COMM_LEN + 1]; |
| 54 | #endif | 55 | #endif |
| 55 | SEQ_printf(m, " #%d: ", idx); | 56 | SEQ_printf(m, " #%d: ", idx); |
| 56 | print_name_offset(m, timer); | 57 | print_name_offset(m, taddr); |
| 57 | SEQ_printf(m, ", "); | 58 | SEQ_printf(m, ", "); |
| 58 | print_name_offset(m, timer->function); | 59 | print_name_offset(m, timer->function); |
| 59 | SEQ_printf(m, ", S:%02lx", timer->state); | 60 | SEQ_printf(m, ", S:%02lx", timer->state); |
| @@ -65,9 +66,11 @@ print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now) | |||
| 65 | SEQ_printf(m, ", %s/%d", tmp, timer->start_pid); | 66 | SEQ_printf(m, ", %s/%d", tmp, timer->start_pid); |
| 66 | #endif | 67 | #endif |
| 67 | SEQ_printf(m, "\n"); | 68 | SEQ_printf(m, "\n"); |
| 68 | SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n", | 69 | SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n", |
| 69 | (unsigned long long)ktime_to_ns(timer->expires), | 70 | (unsigned long long)ktime_to_ns(hrtimer_get_softexpires(timer)), |
| 70 | (long long)(ktime_to_ns(timer->expires) - now)); | 71 | (unsigned long long)ktime_to_ns(hrtimer_get_expires(timer)), |
| 72 | (long long)(ktime_to_ns(hrtimer_get_softexpires(timer)) - now), | ||
| 73 | (long long)(ktime_to_ns(hrtimer_get_expires(timer)) - now)); | ||
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | static void | 76 | static void |
| @@ -99,7 +102,7 @@ next_one: | |||
| 99 | tmp = *timer; | 102 | tmp = *timer; |
| 100 | spin_unlock_irqrestore(&base->cpu_base->lock, flags); | 103 | spin_unlock_irqrestore(&base->cpu_base->lock, flags); |
| 101 | 104 | ||
| 102 | print_timer(m, &tmp, i, now); | 105 | print_timer(m, timer, &tmp, i, now); |
| 103 | next++; | 106 | next++; |
| 104 | goto next_one; | 107 | goto next_one; |
| 105 | } | 108 | } |
| @@ -109,6 +112,7 @@ next_one: | |||
| 109 | static void | 112 | static void |
| 110 | print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) | 113 | print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) |
| 111 | { | 114 | { |
| 115 | SEQ_printf(m, " .base: %p\n", base); | ||
| 112 | SEQ_printf(m, " .index: %d\n", | 116 | SEQ_printf(m, " .index: %d\n", |
| 113 | base->index); | 117 | base->index); |
| 114 | SEQ_printf(m, " .resolution: %Lu nsecs\n", | 118 | SEQ_printf(m, " .resolution: %Lu nsecs\n", |
| @@ -183,12 +187,16 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now) | |||
| 183 | 187 | ||
| 184 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 188 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
| 185 | static void | 189 | static void |
| 186 | print_tickdevice(struct seq_file *m, struct tick_device *td) | 190 | print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) |
| 187 | { | 191 | { |
| 188 | struct clock_event_device *dev = td->evtdev; | 192 | struct clock_event_device *dev = td->evtdev; |
| 189 | 193 | ||
| 190 | SEQ_printf(m, "\n"); | 194 | SEQ_printf(m, "\n"); |
| 191 | SEQ_printf(m, "Tick Device: mode: %d\n", td->mode); | 195 | SEQ_printf(m, "Tick Device: mode: %d\n", td->mode); |
| 196 | if (cpu < 0) | ||
| 197 | SEQ_printf(m, "Broadcast device\n"); | ||
| 198 | else | ||
| 199 | SEQ_printf(m, "Per CPU device: %d\n", cpu); | ||
| 192 | 200 | ||
| 193 | SEQ_printf(m, "Clock Event Device: "); | 201 | SEQ_printf(m, "Clock Event Device: "); |
| 194 | if (!dev) { | 202 | if (!dev) { |
| @@ -222,7 +230,7 @@ static void timer_list_show_tickdevices(struct seq_file *m) | |||
| 222 | int cpu; | 230 | int cpu; |
| 223 | 231 | ||
| 224 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 232 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
| 225 | print_tickdevice(m, tick_get_broadcast_device()); | 233 | print_tickdevice(m, tick_get_broadcast_device(), -1); |
| 226 | SEQ_printf(m, "tick_broadcast_mask: %08lx\n", | 234 | SEQ_printf(m, "tick_broadcast_mask: %08lx\n", |
| 227 | tick_get_broadcast_mask()->bits[0]); | 235 | tick_get_broadcast_mask()->bits[0]); |
| 228 | #ifdef CONFIG_TICK_ONESHOT | 236 | #ifdef CONFIG_TICK_ONESHOT |
| @@ -232,7 +240,7 @@ static void timer_list_show_tickdevices(struct seq_file *m) | |||
| 232 | SEQ_printf(m, "\n"); | 240 | SEQ_printf(m, "\n"); |
| 233 | #endif | 241 | #endif |
| 234 | for_each_online_cpu(cpu) | 242 | for_each_online_cpu(cpu) |
| 235 | print_tickdevice(m, tick_get_device(cpu)); | 243 | print_tickdevice(m, tick_get_device(cpu), cpu); |
| 236 | SEQ_printf(m, "\n"); | 244 | SEQ_printf(m, "\n"); |
| 237 | } | 245 | } |
| 238 | #else | 246 | #else |
| @@ -244,7 +252,7 @@ static int timer_list_show(struct seq_file *m, void *v) | |||
| 244 | u64 now = ktime_to_ns(ktime_get()); | 252 | u64 now = ktime_to_ns(ktime_get()); |
| 245 | int cpu; | 253 | int cpu; |
| 246 | 254 | ||
| 247 | SEQ_printf(m, "Timer List Version: v0.3\n"); | 255 | SEQ_printf(m, "Timer List Version: v0.4\n"); |
| 248 | SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES); | 256 | SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES); |
| 249 | SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now); | 257 | SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now); |
| 250 | 258 | ||
