Skip to content

Commit

Permalink
Merge branch 'stacktrace-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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
  • Loading branch information
torvalds committed Apr 4, 2009
2 parents c7edad5 + 4a44bac commit 30a39e0
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,22 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
return e;
}

static inline int init_kernel_text(unsigned long addr)
{
if (addr >= (unsigned long)_sinittext &&
addr <= (unsigned long)_einittext)
return 1;
return 0;
}

__notrace_funcgraph int core_kernel_text(unsigned long addr)
{
if (addr >= (unsigned long)_stext &&
addr <= (unsigned long)_etext)
return 1;

if (system_state == SYSTEM_BOOTING &&
addr >= (unsigned long)_sinittext &&
addr <= (unsigned long)_einittext)
init_kernel_text(addr))
return 1;
return 0;
}
Expand All @@ -58,7 +65,19 @@ __notrace_funcgraph int __kernel_text_address(unsigned long addr)
{
if (core_kernel_text(addr))
return 1;
return __module_text_address(addr) != NULL;
if (__module_text_address(addr))
return 1;
/*
* There might be init symbols in saved stacktraces.
* Give those symbols a chance to be printed in
* backtraces (such as lockdep traces).
*
* Since we are after the module-symbols check, there's
* no danger of address overlap:
*/
if (init_kernel_text(addr))
return 1;
return 0;
}

int kernel_text_address(unsigned long addr)
Expand Down

0 comments on commit 30a39e0

Please sign in to comment.