14 #include <linux/module.h>
16 #include <linux/sched.h>
21 #include <asm/uaccess.h>
31 #define SEQ_printf(m, x...) \
39 static void print_name_offset(
struct seq_file *m,
void *sym)
53 #ifdef CONFIG_TIMER_STATS
57 print_name_offset(m, taddr);
59 print_name_offset(m, timer->
function);
61 #ifdef CONFIG_TIMER_STATS
63 print_name_offset(m, timer->start_site);
66 SEQ_printf(m,
", %s/%d", tmp, timer->start_pid);
69 SEQ_printf(m,
" # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n",
70 (
unsigned long long)ktime_to_ns(hrtimer_get_softexpires(timer)),
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));
81 unsigned long next = 0,
i;
89 curr = timerqueue_getnext(&base->
active);
94 while (curr &&
i < next) {
105 print_timer(m, timer, &tmp,
i, now);
119 (
unsigned long long)ktime_to_ns(base->
resolution));
121 print_name_offset(m, base->
get_time);
123 #ifdef CONFIG_HIGH_RES_TIMERS
125 (
unsigned long long) ktime_to_ns(base->
offset));
128 print_active_timers(m, base, now);
143 SEQ_printf(m, " .%-15s: %Lu\n", #x, \
144 (unsigned long long)(cpu_base->x))
146 SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
147 (unsigned long long)(ktime_to_ns(cpu_base->x)))
149 #ifdef CONFIG_HIGH_RES_TIMERS
160 #ifdef CONFIG_TICK_ONESHOT
162 SEQ_printf(m, " .%-15s: %Lu\n", #x, \
163 (unsigned long long)(ts->x))
165 SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
166 (unsigned long long)(ktime_to_ns(ts->x)))
175 P_ns(idle_entrytime);
178 P_ns(idle_sleeptime);
179 P_ns(iowait_sleeptime);
184 (
unsigned long long)jiffies);
192 #ifdef CONFIG_GENERIC_CLOCKEVENTS
194 print_tickdevice(
struct seq_file *m,
struct tick_device *
td,
int cpu)
196 struct clock_event_device *
dev = td->evtdev;
199 SEQ_printf(m,
"Tick Device: mode: %d\n", td->mode);
212 (
unsigned long long) dev->max_delta_ns);
214 (
unsigned long long) dev->min_delta_ns);
219 (
unsigned long long) ktime_to_ns(dev->next_event));
222 print_name_offset(m, dev->set_next_event);
226 print_name_offset(m, dev->set_mode);
230 print_name_offset(m, dev->event_handler);
232 SEQ_printf(m,
" retries: %lu\n", dev->retries);
235 static void timer_list_show_tickdevices(
struct seq_file *m)
239 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
243 #ifdef CONFIG_TICK_ONESHOT
244 SEQ_printf(m,
"tick_broadcast_oneshot_mask: %08lx\n",
254 static void timer_list_show_tickdevices(
struct seq_file *m) { }
257 static int timer_list_show(
struct seq_file *m,
void *
v)
263 SEQ_printf(m,
"HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
264 SEQ_printf(m,
"now at %Ld nsecs\n", (
unsigned long long)now);
267 print_cpu(m, cpu, now);
270 timer_list_show_tickdevices(m);
280 static int timer_list_open(
struct inode *
inode,
struct file *filp)
286 .open = timer_list_open,
292 static int __init init_timer_list_procfs(
void)
296 pe = proc_create(
"timer_list", 0444,
NULL, &timer_list_fops);