Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.rutgers.edu, linux-alpha@vger.rutgers.edu,
	axp-list@redhat.com
Subject: Re: kernel profiling in 2.1 ?
Date: Sun, 17 May 1998 23:19:57 +0200	[thread overview]
Message-ID: <19980517231957.33622@alpha.franken.de> (raw)
In-Reply-To: <Pine.LNX.3.95.980517113511.7404A-100000@penguin.transmeta.com>; from Linus Torvalds on Sun, May 17, 1998 at 11:36:54AM -0700

On Sun, May 17, 1998 at 11:36:54AM -0700, Linus Torvalds wrote:
> It may be that the non-x86 profiling was broken - the profiling code was
> moved into architecture-specific code in order to get it right on SMP. It
> definitely works on x86, I'm using it occasionally (and it's sad how much
> time is spent getting the kernel lock).

ok, I forgot to grep the .h, so I missed the x86 profile implementation.
But for the alpha there is (was) no profiling. I just adapted the x86
version, and it works.

Now to my problem with the sluggishness of my machine. I realized, that
when the kernel gets gzipped the mouse pointer under X freezes for as
long as gzip runs. So I did a gzip < /dev/zero > /dev/null and was really
surprised, when the whole machine stopped. I couldn't stop the process,
login via ethernet, nothing. I had to reset it. 

Another thing, which halts the machine for some seconds (and terminates by 
itself) is something like dd if=/dev/zero of=/dev/null count=1000000. The
profile of such a dd run, doesn't show anything strange:

    11 do_wp_page                                 0.0105
    18 ret_from_sys_call                          0.5625
    19 loop                                       1.1875
    45 write_null                                 5.6250
    49 ret_from_reschedule                        1.5312
    84 ret_from_handle_bh                         7.0000
   238 sys_read                                   0.4648
   308 restore_all                                2.2000
   408 read_zero                                  0.5050
   422 entSys                                     2.1979
   462 sys_write                                  0.7500
   697 __copy_user                                1.4893
  2828 total                                      0.0020

Any idea ?

Thomas.

PS: profiling patch for Alpha


Index: time.c
===================================================================
RCS file: /usr/src/cvs/linux/arch/alpha/kernel/time.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 time.c
--- time.c	1998/05/10 21:12:24	1.1.1.7
+++ time.c	1998/05/17 21:07:30
@@ -90,6 +90,26 @@
 	smp_percpu_timer_interrupt(regs);
 	if (smp_processor_id() != boot_cpu_id)
 	  return;
+#else
+#ifdef CONFIG_PROFILE
+        if(!user_mode(regs)) {
+        	if (prof_buffer && current->pid) {
+                	extern int _stext;
+			unsigned long pc = regs->pc;
+
+                	pc -= (unsigned long) &_stext;
+                	pc >>= prof_shift;
+                	/*
+                 	* Dont ignore out-of-bounds pc values silently,
+                 	* put them into the last histogram slot, so if
+                 	* present, they will show up as a sharp peak.
+                 	*/
+                	if (pc > prof_len-1)
+                        	pc = prof_len-1;
+                	atomic_inc((atomic_t *)&prof_buffer[pc]);
+        	}
+	}
+#endif
 #endif
 
 	/*



-- 
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
                   [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]


       reply	other threads:[~1998-05-17 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <19980517132147.20573@alpha.franken.de>
     [not found] ` <Pine.LNX.3.95.980517113511.7404A-100000@penguin.transmeta.com>
1998-05-17 21:19   ` Thomas Bogendoerfer [this message]
     [not found]     ` <Pine.LNX.3.95.980517150058.11803A-100000@penguin.transmeta.com>
1998-05-17 22:41       ` kernel profiling in 2.1 ? Thomas Bogendoerfer
     [not found]         ` <Pine.LNX.3.95.980517204428.15284D-100000@penguin.transmeta.com>
1998-05-18  6:02           ` Thomas Bogendoerfer
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox