diff options
| author | John Levon <levon@movementarian.org> | 2002-10-15 04:30:38 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-15 04:30:38 -0700 |
| commit | 120790b8fe2d901d99f459a567fefbb35c2d15e1 (patch) | |
| tree | a3abac277c8b40f171364bedb3f2309ceb2062b0 /init | |
| parent | 7e1aee05c99cfbb7e5cf33bae11ab9fa8df6c57c (diff) | |
[PATCH] oprofile - timer hook
This implements a simple hook into the profiling timer for x86 so that
non-perfctr machines can still use oprofile. This has proven useful for
laptops and the like.
It also reduces header dependencies a bit by centralising readprofile
code
Diffstat (limited to 'init')
| -rw-r--r-- | init/main.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/init/main.c b/init/main.c index c6023edc03f3..1850a1c3686d 100644 --- a/init/main.c +++ b/init/main.c @@ -30,6 +30,7 @@ #include <linux/kernel_stat.h> #include <linux/security.h> #include <linux/workqueue.h> +#include <linux/profile.h> #include <asm/io.h> #include <asm/bugs.h> @@ -52,7 +53,6 @@ #error Sorry, your GCC is too old. It builds incorrect kernels. #endif -extern char _stext, _etext; extern char *linux_banner; static int init(void *); @@ -130,13 +130,6 @@ __setup("maxcpus=", maxcpus); static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; -static int __init profile_setup(char *str) -{ - int par; - if (get_option(&str,&par)) prof_shift = par; - return 1; -} - __setup("profile=", profile_setup); static int __init checksetup(char *line) @@ -411,16 +404,7 @@ asmlinkage void __init start_kernel(void) #ifdef CONFIG_MODULES init_modules(); #endif - if (prof_shift) { - unsigned int size; - /* only text is profiled */ - prof_len = (unsigned long) &_etext - (unsigned long) &_stext; - prof_len >>= prof_shift; - - size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1; - prof_buffer = (unsigned int *) alloc_bootmem(size); - } - + profile_init(); kmem_cache_init(); local_irq_enable(); calibrate_delay(); |
