From f1f13fef01f716999db4eb764c9e0d87ceb2af1f Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 22 Sep 2005 20:10:38 +0000 Subject: 2005-09-22 Martin Hunt * 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 --- runtime/runtime.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index b0fc5b5d..94a210a6 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -61,15 +61,15 @@ static struct #include "arith.c" #include "copy.c" +/************* Module Stuff ********************/ +#if defined (__x86_64__) || defined (__i386__) +#define HAS_LOOKUP 1 static int (*_stp_kta)(unsigned long addr); static const char * (*_stp_kallsyms_lookup)(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, char *namebuf); -/************* Module Stuff ********************/ -int probe_start(void); - int init_module (void) { _stp_kta = (int (*)(unsigned long))kallsyms_lookup_name("__kernel_text_address"); @@ -77,6 +77,14 @@ int init_module (void) kallsyms_lookup_name("kallsyms_lookup"); return _stp_transport_init(); } +#else +int init_module (void) +{ + return _stp_transport_init(); +} +#endif + +int probe_start(void); void cleanup_module(void) { -- cgit