[linux-yocto] [PATCH 1/2] Revert "timer_list: Convert timer list to be a proper seq_file"
Tom Zanussi
tom.zanussi at linux.intel.com
Wed Aug 28 12:24:08 PDT 2013
This reverts commit b3956a896ea57f25cacd74708b8fab611543a81d.
This is a temporary workaround for the dropbearkey hang issue in 3.10.
---
kernel/time/timer_list.c | 89 +++++++-----------------------------------------
1 file changed, 12 insertions(+), 77 deletions(-)
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 3bdf283..380a589 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -20,13 +20,6 @@
#include <asm/uaccess.h>
-
-struct timer_list_iter {
- int cpu;
- bool second_pass;
- u64 now;
-};
-
typedef void (*print_fn_t)(struct seq_file *m, unsigned int *classes);
DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
@@ -254,101 +247,43 @@ static void timer_list_show_tickdevices_header(struct seq_file *m)
}
#endif
-static inline void timer_list_header(struct seq_file *m, u64 now)
-{
- SEQ_printf(m, "Timer List Version: v0.7\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);
- SEQ_printf(m, "\n");
-}
-
static int timer_list_show(struct seq_file *m, void *v)
{
- struct timer_list_iter *iter = v;
- u64 now = ktime_to_ns(ktime_get());
-
- if (iter->cpu == -1 && !iter->second_pass)
- timer_list_header(m, now);
- else if (!iter->second_pass)
- print_cpu(m, iter->cpu, iter->now);
-#ifdef CONFIG_GENERIC_CLOCKEVENTS
- else if (iter->cpu == -1 && iter->second_pass)
- timer_list_show_tickdevices_header(m);
- else
- print_tickdevice(m, tick_get_device(iter->cpu), iter->cpu);
-#endif
- return 0;
-}
-
-void sysrq_timer_list_show(void)
-{
u64 now = ktime_to_ns(ktime_get());
int cpu;
- timer_list_header(NULL, now);
+ SEQ_printf(m, "Timer List Version: v0.7\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);
+ SEQ_printf(m, "\n");
for_each_online_cpu(cpu)
- print_cpu(NULL, cpu, now);
+ print_cpu(m, cpu, now);
#ifdef CONFIG_GENERIC_CLOCKEVENTS
- timer_list_show_tickdevices_header(NULL);
+ timer_list_show_tickdevices_header(m);
for_each_online_cpu(cpu)
- print_tickdevice(NULL, tick_get_device(cpu), cpu);
+ print_tickdevice(m, tick_get_device(cpu), cpu);
#endif
- return;
-}
-static void *timer_list_start(struct seq_file *file, loff_t *offset)
-{
- struct timer_list_iter *iter = file->private;
-
- if (!*offset) {
- iter->cpu = -1;
- iter->now = ktime_to_ns(ktime_get());
- } else if (iter->cpu >= nr_cpu_ids) {
-#ifdef CONFIG_GENERIC_CLOCKEVENTS
- if (!iter->second_pass) {
- iter->cpu = -1;
- iter->second_pass = true;
- } else
- return NULL;
-#else
- return NULL;
-#endif
- }
- return iter;
-}
-
-static void *timer_list_next(struct seq_file *file, void *v, loff_t *offset)
-{
- struct timer_list_iter *iter = file->private;
- iter->cpu = cpumask_next(iter->cpu, cpu_online_mask);
- ++*offset;
- return timer_list_start(file, offset);
+ return 0;
}
-static void timer_list_stop(struct seq_file *seq, void *v)
+void sysrq_timer_list_show(void)
{
+ timer_list_show(NULL, NULL);
}
-static const struct seq_operations timer_list_sops = {
- .start = timer_list_start,
- .next = timer_list_next,
- .stop = timer_list_stop,
- .show = timer_list_show,
-};
-
static int timer_list_open(struct inode *inode, struct file *filp)
{
- return seq_open_private(filp, &timer_list_sops,
- sizeof(struct timer_list_iter));
+ return single_open(filp, timer_list_show, NULL);
}
static const struct file_operations timer_list_fops = {
.open = timer_list_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release_private,
+ .release = single_release,
};
static int __init init_timer_list_procfs(void)
--
1.7.11.4
More information about the linux-yocto
mailing list