The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: torvalds@transmeta.com, Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] Allow for profile_buf size = kernel text size
Date: Fri, 18 Oct 2002 14:54:56 +0530	[thread overview]
Message-ID: <20021018145456.A2749@in.ibm.com> (raw)

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


diff -X dontdiff -ruN linux-2.5.43/fs/proc/proc_misc.c readprofile-2.5.43/fs/proc/proc_misc.c
--- linux-2.5.43/fs/proc/proc_misc.c	Wed Oct 16 08:57:18 2002
+++ readprofile-2.5.43/fs/proc/proc_misc.c	Fri Oct 18 10:13:44 2002
@@ -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;
diff -X dontdiff -ruN linux-2.5.43/include/linux/profile.h readprofile-2.5.43/include/linux/profile.h
--- linux-2.5.43/include/linux/profile.h	Wed Oct 16 08:58:20 2002
+++ readprofile-2.5.43/include/linux/profile.h	Thu Oct 17 16:58:56 2002
@@ -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 {
diff -X dontdiff -ruN linux-2.5.43/kernel/profile.c readprofile-2.5.43/kernel/profile.c
--- linux-2.5.43/kernel/profile.c	Wed Oct 16 08:59:04 2002
+++ readprofile-2.5.43/kernel/profile.c	Thu Oct 17 17:00:27 2002
@@ -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 */

                 reply	other threads:[~2002-10-18  9:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021018145456.A2749@in.ibm.com \
    --to=kiran@in.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox