summaryrefslogtreecommitdiffstats
path: root/runtime/sym.h
diff options
context:
space:
mode:
authorhunt <hunt>2006-11-02 18:37:00 +0000
committerhunt <hunt>2006-11-02 18:37:00 +0000
commitf1bad60c76d79f01a87e4128df266bf4252a71e0 (patch)
tree5114f087d844e702253a439efbcc36e310268a4b /runtime/sym.h
parent202e1828643725d7bebef76c48cbaa28c463cee3 (diff)
downloadsystemtap-steved-f1bad60c76d79f01a87e4128df266bf4252a71e0.tar.gz
systemtap-steved-f1bad60c76d79f01a87e4128df266bf4252a71e0.tar.xz
systemtap-steved-f1bad60c76d79f01a87e4128df266bf4252a71e0.zip
New dynamic module and symbol handling code.
Diffstat (limited to 'runtime/sym.h')
-rw-r--r--runtime/sym.h53
1 files changed, 46 insertions, 7 deletions
diff --git a/runtime/sym.h b/runtime/sym.h
index 6ed08b06..4bbbbbb5 100644
--- a/runtime/sym.h
+++ b/runtime/sym.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Red Hat Inc.
+ * Copyright (C) 2005, 2006 Red Hat Inc.
*
* This file is part of systemtap, and is free software. You can
* redistribute it and/or modify it under the terms of the GNU General
@@ -10,16 +10,55 @@
#ifndef _STAP_SYMBOLS_H_
#define _STAP_SYMBOLS_H_
+#define STP_MODULE_NAME_LEN 64
-/* A symbol table defined by the translator. */
-struct stap_symbol {
+struct _stp_symbol {
unsigned long addr;
const char *symbol;
- const char *modname;
};
-extern struct stap_symbol stap_symbols [];
-extern unsigned stap_num_symbols;
+struct _stp_module {
+ /* the module name, or "" for kernel */
+ char name[STP_MODULE_NAME_LEN];
+ /* A pointer to the struct module. Note that we cannot */
+ /* trust this because as of 2.6.19, there are not yet */
+ /* any notifier hooks that will tell us when a module */
+ /* is unloading. */
+ unsigned long module;
-#endif /* _RUNTIME_H_ */
+ /* the start of the module's text and data sections */
+ unsigned long text;
+ unsigned long data;
+
+ /* how many symbols this module has that we are interested in */
+ unsigned num_symbols;
+
+ /* how many sections this module has */
+ unsigned num_sections;
+ struct _stp_symbol *sections;
+
+ /* how the symbol_data below was allocated */
+ int allocated; /* 0 = kmalloc, 1 = vmalloc */
+
+ /* an array of num_symbols _stp_symbol structs */
+ struct _stp_symbol *symbols; /* ordered by address */
+
+ /* where we stash our copy of the strtab */
+ void *symbol_data; /* private */
+};
+
+#ifndef STP_MAX_MODULES
+#define STP_MAX_MODULES 128
+#endif
+
+/* the alphabetical array of modules */
+struct _stp_module *_stp_modules[STP_MAX_MODULES];
+
+/* the array of modules ordered by addresses */
+struct _stp_module *_stp_modules_by_addr[STP_MAX_MODULES];
+
+/* the number of modules in the arrays */
+int _stp_num_modules = 0;
+
+#endif /* _STAP_SYMBOLS_H_ */