From cec8421d4715d2e43f8630ea6ad39766eeb4d0b6 Mon Sep 17 00:00:00 2001 From: andreast Date: Fri, 20 Jan 2012 22:34:19 +0000 Subject: This commit adds profiling support for powerpc64. Now we can do application profiling and kernel profiling. To enable kernel profiling one has to build kgmon(8). I will enable the build once I managed to build and test powerpc (32-bit) kernels with profiling support. - add a powerpc64 PROF_PROLOGUE for _mcount. - add macros to avoid adding the PROF_PROLOGUE in certain assembly entries. - apply these macros where needed. - add size information to the MCOUNT function. MFC after: 3 weeks, together with r230291 --- sys/powerpc/aim/locore64.S | 4 ++-- sys/powerpc/aim/swtch64.S | 9 +++++---- sys/powerpc/aim/trap_subr64.S | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'sys/powerpc/aim') diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 64e4e62..83d9048 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -115,7 +115,7 @@ kernel_text: * segment! */ .text -ASENTRY(__start) +ASENTRY_NOPROF(__start) li 8,0 li 9,0x100 mtctr 9 @@ -202,7 +202,7 @@ tocbase: * or the (currently used) C code optimized, so it doesn't use any non-volatile * registers. */ -ASENTRY(setfault) +ASENTRY_NOPROF(setfault) mflr 0 mfcr 12 mfsprg 4,0 diff --git a/sys/powerpc/aim/swtch64.S b/sys/powerpc/aim/swtch64.S index c5cdcbc..489ec40 100644 --- a/sys/powerpc/aim/swtch64.S +++ b/sys/powerpc/aim/swtch64.S @@ -68,7 +68,7 @@ /* * void cpu_throw(struct thread *old, struct thread *new) */ -ENTRY(cpu_throw) +ENTRY_NOPROF(cpu_throw) mr %r13, %r4 b cpu_switchin @@ -79,7 +79,7 @@ ENTRY(cpu_throw) * * Switch to a new thread saving the current state in the old thread. */ -ENTRY(cpu_switch) +ENTRY_NOPROF(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ @@ -237,7 +237,7 @@ blocked_loop: * savectx(pcb) * Update pcb, saving current processor state */ -ENTRY(savectx) +ENTRY_NOPROF(savectx) std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ std %r13,PCB_CONTEXT+1*8(%r3) std %r14,PCB_CONTEXT+2*8(%r3) @@ -268,7 +268,8 @@ ENTRY(savectx) * fork_trampoline() * Set up the return from cpu_fork() */ -ENTRY(fork_trampoline) + +ENTRY_NOPROF(fork_trampoline) ld %r3,CF_FUNC(%r1) ld %r4,CF_ARG0(%r1) ld %r5,CF_ARG1(%r1) diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index 82935e7..8243dc7 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -703,7 +703,7 @@ CNAME(asttrapexit): /* * Deliberate entry to dbtrap */ -ASENTRY(breakpoint) +ASENTRY_NOPROF(breakpoint) mtsprg1 %r1 mfmsr %r3 mtsrr1 %r3 -- cgit v1.1