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

---
 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

_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Reply via email to