summaryrefslogtreecommitdiffstats
path: root/sys/sys/linker.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-12-01 19:24:28 +0000
committerrwatson <rwatson@FreeBSD.org>2007-12-01 19:24:28 +0000
commit0ab794a171ac6568b244e0f424efa9bcf4eb25a1 (patch)
tree49ec045f2a807b5eb7974c2cc2171f8195ac1b06 /sys/sys/linker.h
parent8df55e4f8662732d62efb9b039f3d1863a0a2266 (diff)
downloadFreeBSD-src-0ab794a171ac6568b244e0f424efa9bcf4eb25a1.zip
FreeBSD-src-0ab794a171ac6568b244e0f424efa9bcf4eb25a1.tar.gz
The kernel linker includes a number of utility functions to look up symbol
information in support of DDB(4); these functions bypass normal linker locking as they may run in contexts where locking is unsafe (such as the kernel debugger). Add a new interface linker_ddb_search_symbol_name(), which looks up a symbol name and offset given an address, and also linker_search_symbol_name() which does the same but *does* follow the locking conventions of the linker. Unlike existing functions, these functions place the name in a caller-provided buffer, which is stable even after linker locks have been released. These functions will be used in upcoming revisions to stack(9) to support kernel stack trace generation in contexts as part of a live, rather than suspended, kernel.
Diffstat (limited to 'sys/sys/linker.h')
-rw-r--r--sys/sys/linker.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index c5087c8..6655d46 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -176,6 +176,14 @@ int linker_ddb_lookup(const char *_symstr, c_linker_sym_t *_sym);
int linker_ddb_search_symbol(caddr_t _value, c_linker_sym_t *_sym,
long *_diffp);
int linker_ddb_symbol_values(c_linker_sym_t _sym, linker_symval_t *_symval);
+int linker_ddb_search_symbol_name(caddr_t value, char *buf, u_int buflen,
+ long *offset);
+
+/*
+ * stack(9) helper for situations where kernel locking is required.
+ */
+int linker_search_symbol_name(caddr_t value, char *buf, u_int buflen,
+ long *offset);
/* HWPMC helper */
OpenPOWER on IntegriCloud