* [Adeos-main] [PATCH] x86-32: micro-optimize mcount trampoline
@ 2008-01-10 16:31 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2008-01-10 16:31 UTC (permalink / raw)
To: adeos-main; +Cc: Philippe Gerum
[-- Attachment #1: Type: text/plain, Size: 306 bytes --]
Looking at the 64-bit variant and the implementation in glibc, I noticed
that we can still save some cycles in current mcount_32. With this patch
applied, the tracer still works and provides consistent output.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
[-- Attachment #2: optimize-x86-32-mcount.patch --]
[-- Type: text/x-patch, Size: 842 bytes --]
---
arch/x86/kernel/mcount_32.S | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
Index: linux-2.6.24-rc6-xeno/arch/x86/kernel/mcount_32.S
===================================================================
--- linux-2.6.24-rc6-xeno.orig/arch/x86/kernel/mcount_32.S
+++ linux-2.6.24-rc6-xeno/arch/x86/kernel/mcount_32.S
@@ -9,17 +9,13 @@ mcount:
cmpl $0,ipipe_trace_enable
je out
- pushl %ebp
- movl %esp,%ebp
-
pushl %eax
pushl %ecx
pushl %edx
pushl $0 # no additional value (v)
- movl (%ebp),%eax
- movl 0x4(%ebp),%edx # __CALLER_ADDR0
- movl 0x4(%eax),%ecx # __CALLER_ADDR1
+ movl 4(%ebp),%ecx # __CALLER_ADDR1
+ movl 16(%esp),%edx # __CALLER_ADDR0
movl $0,%eax # IPIPE_TRACE_FUNC
call __ipipe_trace
popl %eax
@@ -27,6 +23,5 @@ mcount:
popl %edx
popl %ecx
popl %eax
- popl %ebp
out:
ret
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-10 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-10 16:31 [Adeos-main] [PATCH] x86-32: micro-optimize mcount trampoline Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.