Allow for profile_buf size = kernel text size
PATCH 1/1 Allow for profile_buf size = kernel text size
Hi
The following patch enables the kernel profiler to set up profiling buffer equal to the kernel text size. It is particularly useful while doing insn level profiling on archs with variable sized instructions. There is a better possiblity of ticks being attributed to the right instructions if the profiling granularity is better. Patch applies neatly on 2.5.43 and 2.5.43-mm2. Tested well on PIII 4way. Please apply.
-Kiran
fs/proc/proc_misc.c +1 -1
@@ -648,7 +648,7 @@ proc_root_kcore->size = (size_t )high_memory -PAGE_OFFSET +PAGE_SIZE ; } -if (prof_shift) { +if (prof_on) { entry =create_proc_entry ("profile" ,S_IWUSR |S_IRUGO ,NULL );if (entry) { entry->proc_fops = &proc_profile_operations;
include/linux/profile.h +1 -0
@@ -17,6 +17,7 @@extern unsigned int * prof_buffer;extern unsigned long prof_len;extern unsigned long prof_shift; +extern int prof_on;enum profile_type {
kernel/profile.c +5 -2
@@ -14,12 +14,15 @@unsigned int * prof_buffer;unsigned long prof_len;unsigned long prof_shift; +int prof_on;int __init profile_setup (char * str) {int par; -if (get_option (&str,&par)) +if (get_option (&str,&par)) { prof_shift = par; + prof_on =1 ; + }return 1 ; }
@@ -28,7 +31,7 @@ {unsigned int size; -if (!prof_shift) +if (!prof_on)return ;/* only text is profiled */