Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80189
b: refs/heads/master
c: 79b4cc5
h: refs/heads/master
i:
  80187: 6f41f66
v: v3
  • Loading branch information
Arjan van de Ven authored and Ingo Molnar committed Jan 30, 2008
1 parent e39b01b commit 6fd22f1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a6a62f96f168d192fb0cc9c0b5ee2584740b32d
refs/heads/master: 79b4cc5ee7a8086ac2c9c0afa52e6d687ce1ffef
10 changes: 5 additions & 5 deletions trunk/include/asm-generic/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ struct bug_entry {
#endif

#ifndef __WARN
#define __WARN() do { \
printk("WARNING: at %s:%d %s()\n", __FILE__, \
__LINE__, __FUNCTION__); \
dump_stack(); \
} while (0)
#ifndef __ASSEMBLY__
extern void warn_on_slowpath(const char *file, const int line);
#define WANT_WARN_ON_SLOWPATH
#endif
#define __WARN() warn_on_slowpath(__FILE__, __LINE__)
#endif

#ifndef WARN_ON
Expand Down
15 changes: 15 additions & 0 deletions trunk/kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/kexec.h>
#include <linux/debug_locks.h>
#include <linux/random.h>
#include <linux/kallsyms.h>

int panic_on_oops;
int tainted;
Expand Down Expand Up @@ -292,6 +293,20 @@ void oops_exit(void)
(unsigned long long)oops_id);
}

#ifdef WANT_WARN_ON_SLOWPATH
void warn_on_slowpath(const char *file, int line)
{
char function[KSYM_SYMBOL_LEN];
unsigned long caller = (unsigned long) __builtin_return_address(0);

sprint_symbol(function, caller);
printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
line, function);
dump_stack();
}
EXPORT_SYMBOL(warn_on_slowpath);
#endif

#ifdef CONFIG_CC_STACKPROTECTOR
/*
* Called when gcc's -fstack-protector feature is used, and
Expand Down

0 comments on commit 6fd22f1

Please sign in to comment.