summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.h
diff options
context:
space:
mode:
authorhunt <hunt>2005-10-19 21:04:34 +0000
committerhunt <hunt>2005-10-19 21:04:34 +0000
commitf6f492468e2dfec286e3611e3e38ad070c91ae9d (patch)
tree647507d998d07f069bf5fc4bb1dc121c6023d507 /runtime/runtime.h
parent08c68653dd3dc7921339dfe4627c464ef4249faa (diff)
downloadsystemtap-steved-f6f492468e2dfec286e3611e3e38ad070c91ae9d.tar.gz
systemtap-steved-f6f492468e2dfec286e3611e3e38ad070c91ae9d.tar.xz
systemtap-steved-f6f492468e2dfec286e3611e3e38ad070c91ae9d.zip
2005-10-19 Martin Hunt <hunt@redhat.com>
* runtime.h (_stp_kallsyms_lookup_tabled): Only compile this for systemtap. Runtime-only examples don't need it.
Diffstat (limited to 'runtime/runtime.h')
-rw-r--r--runtime/runtime.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/runtime.h b/runtime/runtime.h
index bcee85d5..e077c29a 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -70,7 +70,12 @@ static const char * (*_stp_kallsyms_lookup)(unsigned long addr,
unsigned long *offset,
char **modname, char *namebuf);
+/* TEST_MODE is always defined by systemtap */
+#ifdef TEST_MODE
+#define SYSTEMTAP 1
+#endif
+#ifdef SYSTEMTAP
/* This implementation is used if stap_[num_]symbols are available. */
static const char * _stp_kallsyms_lookup_tabled (unsigned long addr,
unsigned long *symbolsize,
@@ -118,16 +123,17 @@ static const char * _stp_kallsyms_lookup_tabled (unsigned long addr,
return s->symbol;
}
}
-
-
+#endif
int init_module (void)
{
_stp_kta = (int (*)(unsigned long))kallsyms_lookup_name("__kernel_text_address");
+#ifdef SYSTEMTAP
if (stap_num_symbols > 0)
_stp_kallsyms_lookup = & _stp_kallsyms_lookup_tabled;
else
+#endif
_stp_kallsyms_lookup = (const char * (*)(unsigned long,unsigned long *,unsigned long *,char **,char *))
kallsyms_lookup_name("kallsyms_lookup");