diff options
author | hunt <hunt> | 2005-09-22 20:10:38 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-09-22 20:10:38 +0000 |
commit | f1f13fef01f716999db4eb764c9e0d87ceb2af1f (patch) | |
tree | b27da63ba46c7cced2ef9698bffdd9e2c19a477d /runtime/current.c | |
parent | 07885a7317c11c71a73706fc8af3e32e7da9f4d8 (diff) | |
download | systemtap-steved-f1f13fef01f716999db4eb764c9e0d87ceb2af1f.tar.gz systemtap-steved-f1f13fef01f716999db4eb764c9e0d87ceb2af1f.tar.xz systemtap-steved-f1f13fef01f716999db4eb764c9e0d87ceb2af1f.zip |
2005-09-22 Martin Hunt <hunt@redhat.com>
* runtime.h (init_module): Only initialize _stp_kta and
_stp_kallsyms_lookup on i386 and x86_64. Define HAS_LOOKUP.
* sym.c (_stp_symbol_sprint): If HAS_LOOKUP is not
defined, just print address in hex.
* current.c (_stp_ret_addr): Add ppc64 version.
(_stp_sprint_regs): PPC64 version from
Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Diffstat (limited to 'runtime/current.c')
-rw-r--r-- | runtime/current.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/runtime/current.c b/runtime/current.c index 7edfaf5f..00ddb3e1 100644 --- a/runtime/current.c +++ b/runtime/current.c @@ -29,6 +29,8 @@ unsigned long _stp_ret_addr (struct pt_regs *regs) return 0; #elif defined (__i386__) return regs->esp; +#elif defined (__powerpc64__) + return REG_LINK(regs); #else #error Unimplemented architecture #endif @@ -129,6 +131,40 @@ void _stp_sprint_regs(String str, struct pt_regs * regs) _stp_sprintf (str, "CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); } +#elif defined (__powerpc64__) + +void _stp_sprint_regs(String str, struct pt_regs * regs) +{ + int i; + + _stp_sprintf(str, "NIP: %016lX XER: %08X LR: %016lX CTR: %016lX\n", + regs->nip, (unsigned int)regs->xer, regs->link, regs->ctr); + _stp_sprintf(str, "REGS: %p TRAP: %04lx\n", regs, regs->trap); + _stp_sprintf(str, "MSR: %016lx CR: %08X\n", + regs->msr, (unsigned int)regs->ccr); + _stp_sprintf(str, "DAR: %016lx DSISR: %016lx\n", + regs->dar, regs->dsisr); + +#ifdef CONFIG_SMP + _stp_sprintf(str, " CPU: %d", smp_processor_id()); +#endif /* CONFIG_SMP */ + + for (i = 0; i < 32; i++) { + if ((i % 4) == 0) { + _stp_sprintf(str, "\n GPR%02d: ", i); + } + + _stp_sprintf(str, "%016lX ", regs->gpr[i]); + if (i == 13 && !FULL_REGS(regs)) + break; + } + _stp_string_cat(str, "\n"); + _stp_sprintf(str, "NIP [%016lx] ", regs->nip); + _stp_sprintf(str, "LR [%016lx] ", regs->link); + _stp_string_cat(str, regs->link); + _stp_string_cat(str, "\n"); +} + #endif /** Print the registers. |