Re: profiling the kernel

rubini@pop.systemy.it
Thu, 24 Apr 1997 10:44:37 +0200 (MET DST)


> You should do a echo >/proc/profile before your actual profile to clear
> the profile counters and get useful data.

Well, actually patch-2.1.34 changed the code, and the profiling buffer
is not reset to zero on non-SMP computers. It is not fixed in 35,
don't know about 36.

This (untested) patch should fix it, but try at your own risk...

Regards
/alessandro

--- fs/proc/array.c.orig Thu Apr 24 10:35:20 1997
+++ fs/proc/array.c Thu Apr 24 10:36:52 1997
@@ -154,9 +154,7 @@
return read;
}

-#ifdef __SMP__

-extern int setup_profiling_timer (unsigned int multiplier);

/*
* Writing to /proc/profile resets the counters
@@ -168,6 +166,8 @@
const char * buf, unsigned long count)
{
int i=prof_len;
+#ifdef __SMP__
+ extern int setup_profiling_timer (unsigned int multiplier);

if (count==sizeof(int)) {
unsigned int multiplier;
@@ -178,14 +178,12 @@
if (setup_profiling_timer(multiplier))
return -EINVAL;
}
+#endif

while (i--)
prof_buffer[i]=0UL;
return count;
}
-#else
-#define write_profile NULL
-#endif

static struct file_operations proc_profile_operations = {
NULL, /* lseek */

--
    __ o         Tu vuo` fa` l'americano: sient'a me` chi t'o fa fa`.
   _`\<,                                               (Renato Carosone)
__( )/( )__  alessandro.rubini@linux.it  +39-382-529554