Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[linux-2.6/openmoko-kernel/knife-kernel.git] / kernel / backtracetest.c
blobd1a7605c5b8fe01368e7290f2d215512d646cc32
1 /*
2 * Simple stack backtrace regression test module
4 * (C) Copyright 2008 Intel Corporation
5 * Author: Arjan van de Ven <arjan@linux.intel.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; version 2
10 * of the License.
13 #include <linux/module.h>
14 #include <linux/sched.h>
15 #include <linux/delay.h>
17 static struct timer_list backtrace_timer;
19 static void backtrace_test_timer(unsigned long data)
21 printk("Testing a backtrace from irq context.\n");
22 printk("The following trace is a kernel self test and not a bug!\n");
23 dump_stack();
25 static int backtrace_regression_test(void)
27 printk("====[ backtrace testing ]===========\n");
28 printk("Testing a backtrace from process context.\n");
29 printk("The following trace is a kernel self test and not a bug!\n");
30 dump_stack();
32 init_timer(&backtrace_timer);
33 backtrace_timer.function = backtrace_test_timer;
34 mod_timer(&backtrace_timer, jiffies + 10);
36 msleep(10);
37 printk("====[ end of backtrace testing ]====\n");
38 return 0;
41 static void exitf(void)
45 module_init(backtrace_regression_test);
46 module_exit(exitf);
47 MODULE_LICENSE("GPL");
48 MODULE_AUTHOR("Arjan van de Ven <arjan@linux.intel.com>");