diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 20:34:41 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 20:34:41 -0400 |
| commit | 30a39e0e97f948e3ac8eeacd54d09f4bbfbab64b (patch) | |
| tree | ed7095cbce6a1d6e178ddd12a209004ca439ee1b | |
| parent | c7edad5fcb86c4398f9ab2ccea82ddcc067b88af (diff) | |
| parent | 4a44bac1f98223ed77e47bf3b42fcfd10cddd85f (diff) | |
Merge branch 'stacktrace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'stacktrace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
symbols, stacktrace: look up init symbols after module symbols
| -rw-r--r-- | kernel/extable.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index e136ed8d82ba..c46da6a47036 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
| @@ -41,6 +41,14 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) | |||
| 41 | return e; | 41 | return e; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | static inline int init_kernel_text(unsigned long addr) | ||
| 45 | { | ||
| 46 | if (addr >= (unsigned long)_sinittext && | ||
| 47 | addr <= (unsigned long)_einittext) | ||
| 48 | return 1; | ||
| 49 | return 0; | ||
| 50 | } | ||
| 51 | |||
| 44 | __notrace_funcgraph int core_kernel_text(unsigned long addr) | 52 | __notrace_funcgraph int core_kernel_text(unsigned long addr) |
| 45 | { | 53 | { |
| 46 | if (addr >= (unsigned long)_stext && | 54 | if (addr >= (unsigned long)_stext && |
| @@ -48,8 +56,7 @@ __notrace_funcgraph int core_kernel_text(unsigned long addr) | |||
| 48 | return 1; | 56 | return 1; |
| 49 | 57 | ||
| 50 | if (system_state == SYSTEM_BOOTING && | 58 | if (system_state == SYSTEM_BOOTING && |
| 51 | addr >= (unsigned long)_sinittext && | 59 | init_kernel_text(addr)) |
| 52 | addr <= (unsigned long)_einittext) | ||
| 53 | return 1; | 60 | return 1; |
| 54 | return 0; | 61 | return 0; |
| 55 | } | 62 | } |
| @@ -58,7 +65,19 @@ __notrace_funcgraph int __kernel_text_address(unsigned long addr) | |||
| 58 | { | 65 | { |
| 59 | if (core_kernel_text(addr)) | 66 | if (core_kernel_text(addr)) |
| 60 | return 1; | 67 | return 1; |
| 61 | return __module_text_address(addr) != NULL; | 68 | if (__module_text_address(addr)) |
| 69 | return 1; | ||
| 70 | /* | ||
| 71 | * There might be init symbols in saved stacktraces. | ||
| 72 | * Give those symbols a chance to be printed in | ||
| 73 | * backtraces (such as lockdep traces). | ||
| 74 | * | ||
| 75 | * Since we are after the module-symbols check, there's | ||
| 76 | * no danger of address overlap: | ||
| 77 | */ | ||
| 78 | if (init_kernel_text(addr)) | ||
| 79 | return 1; | ||
| 80 | return 0; | ||
| 62 | } | 81 | } |
| 63 | 82 | ||
| 64 | int kernel_text_address(unsigned long addr) | 83 | int kernel_text_address(unsigned long addr) |
