Index: schedprof-2.6.7/kernel/sched.c =================================================================== --- schedprof-2.6.7.orig/kernel/sched.c 2004-06-24 23:42:11.200272928 -0700 +++ schedprof-2.6.7/kernel/sched.c 2004-06-24 23:42:41.895606528 -0700 @@ -4052,7 +4052,7 @@ #endif /* defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) */ static atomic_t *schedprof_buf; -static int sched_profiling; +static int sched_profiling, schedprof_shift; static unsigned long schedprof_len, schedprof_pages; #include @@ -4062,11 +4062,22 @@ { if (schedprof_buf) { unsigned long pc = (unsigned long)__pc; - pc -= min(pc, (unsigned long)_stext); + pc = (pc - min(pc, (unsigned long)_stext)) >> schedprof_shift; atomic_inc(&schedprof_buf[min(pc + 1, schedprof_len - 1)]); } } +static int __init schedprof_shift_setup(char *s) +{ + int n; + if (get_option(&s, &n)) { + schedprof_shift = n; + sched_profiling = 1; + } + return 1; +} +__setup("schedprof_shift=", schedprof_shift_setup); + static int __init schedprof_setup(char *s) { int n; @@ -4080,11 +4091,11 @@ { if (!sched_profiling) return; - schedprof_len = (unsigned long)(_etext - _stext) + 1; + schedprof_len = ((unsigned long)(_etext-_stext)>>schedprof_shift) + 1; schedprof_buf = alloc_bootmem_pages(sizeof(atomic_t)*schedprof_len); schedprof_pages = PAGE_ALIGN(sizeof(atomic_t)*schedprof_len)/PAGE_SIZE; printk(KERN_INFO "Scheduler call profiling enabled\n"); - atomic_set(&schedprof_buf[0], 1); + atomic_set(&schedprof_buf[0], 1 << schedprof_shift); } #ifdef CONFIG_PROC_FS