summaryrefslogtreecommitdiffstats
path: root/runtime/sym.h
diff options
context:
space:
mode:
authorhunt <hunt>2008-02-27 19:45:45 +0000
committerhunt <hunt>2008-02-27 19:45:45 +0000
commit9a5de18784b77de82e5121861fac892c2d4d2630 (patch)
tree54d0a3fb138a31627788606953bb1cb37897caf8 /runtime/sym.h
parenta2dc47ddef0dbed1b0dc912c876f5f57f97c1ede (diff)
downloadsystemtap-steved-9a5de18784b77de82e5121861fac892c2d4d2630.tar.gz
systemtap-steved-9a5de18784b77de82e5121861fac892c2d4d2630.tar.xz
systemtap-steved-9a5de18784b77de82e5121861fac892c2d4d2630.zip
2008-02-27 Martin Hunt <hunt@redhat.com>
* sym.h (_stp_module): Add text_size, lock, and unwind data pointer. * sym.c (_stp_find_module_by_addr): New function. (_stp_kallsyms_lookup): Call _stp_find_module_by_addr(). (_stp_get_unwind_info): New. * runtime.h: Move debug macros to debug.h. Include it. * debug.h: New file. * map.c: Update debug calls. * map-gen.c: Update debug calls. * pmap-gen.c: Update debug calls. * mempool.c: New file. * symbols.c: Use rwlocks. Use new dbug macros. Handle unwind info if present. * transport.c: Include mempool.c. Update dbug and kbug calls to new macros. * transport_msgs.h (_stp_command_name): Add struct containing message names for debugging. * control.c, procfs.c: Use new dbug macros. Use new mempool functions.
Diffstat (limited to 'runtime/sym.h')
-rw-r--r--runtime/sym.h85
1 files changed, 53 insertions, 32 deletions
diff --git a/runtime/sym.h b/runtime/sym.h
index 6a55a22e..b124882a 100644
--- a/runtime/sym.h
+++ b/runtime/sym.h
@@ -1,5 +1,5 @@
-/*
- * Copyright (C) 2005, 2006 Red Hat Inc.
+/* -*- linux-c -*-
+ * Copyright (C) 2005-2008 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
@@ -13,39 +13,59 @@
#define STP_MODULE_NAME_LEN 64
struct _stp_symbol {
- unsigned long addr;
- const char *symbol;
+ unsigned long addr;
+ const char *symbol;
+};
+struct stap_symbol {
+ unsigned long addr;
+ const char *symbol;
+ const char *module;
};
-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;
-
- /* 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 */
- uint32_t num_symbols;
-
- /* how many sections this module has */
- uint32_t num_sections;
- struct _stp_symbol *sections;
-
- /* how the symbol_data below was allocated */
- int32_t allocated; /* 0 = kmalloc, 1 = vmalloc */
-
- /* an array of num_symbols _stp_symbol structs */
- struct _stp_symbol *symbols; /* ordered by address */
+DEFINE_RWLOCK(_stp_module_lock);
+#define STP_RLOCK_MODULES read_lock_irqsave(&_stp_module_lock, flags)
+#define STP_WLOCK_MODULES write_lock_irqsave(&_stp_module_lock, flags)
+#define STP_RUNLOCK_MODULES read_unlock_irqrestore(&_stp_module_lock, flags)
+#define STP_WUNLOCK_MODULES write_unlock_irqrestore(&_stp_module_lock, flags)
- /* where we stash our copy of the strtab */
- void *symbol_data; /* private */
+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;
+
+ /* the start of the module's text and data sections */
+ unsigned long text;
+ unsigned long data;
+
+ uint32_t text_size;
+
+ /* how many symbols this module has that we are interested in */
+ uint32_t num_symbols;
+
+ /* how many sections this module has */
+ uint32_t num_sections;
+
+ /* how the symbol_data below was allocated */
+ int32_t allocated; /* 0 = kmalloc, 1 = vmalloc */
+
+ struct _stp_symbol *sections;
+
+ /* 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;
+
+ /* the stack unwind data for this module */
+ void *unwind_data;
+ uint32_t unwind_data_len;
+ rwlock_t lock; /* lock while unwinding is happening */
+
};
#ifndef STP_MAX_MODULES
@@ -62,4 +82,5 @@ struct _stp_module *_stp_modules_by_addr[STP_MAX_MODULES];
int _stp_num_modules = 0;
unsigned long _stp_module_relocate (const char *module, const char *section, unsigned long offset);
+static struct _stp_module *_stp_get_unwind_info (unsigned long addr);
#endif /* _STAP_SYMBOLS_H_ */