Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145074
b: refs/heads/master
c: 0f6f49a
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 16, 2009
1 parent e1e748b commit e343a6e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 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: b41a080fa9f157d223c782ec3571cf46e34e91d6
refs/heads/master: 0f6f49a8cd0163fdb1723ed29f01fc65177108dc
35 changes: 20 additions & 15 deletions trunk/kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,39 +340,44 @@ void oops_exit(void)
}

#ifdef WANT_WARN_ON_SLOWPATH
void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
{
struct slowpath_args {
const char *fmt;
va_list args;
char function[KSYM_SYMBOL_LEN];
unsigned long caller = (unsigned long)__builtin_return_address(0);
const char *board;
};

sprint_symbol(function, caller);
static void warn_slowpath_common(const char *file, int line, void *caller, struct slowpath_args *args)
{
const char *board;

printk(KERN_WARNING "------------[ cut here ]------------\n");
printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
line, function);
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
printk(KERN_WARNING "Hardware name: %s\n", board);

if (*fmt) {
va_start(args, fmt);
vprintk(fmt, args);
va_end(args);
}
if (args)
vprintk(args->fmt, args->args);

print_modules();
dump_stack();
print_oops_end_marker();
add_taint(TAINT_WARN);
}

void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
{
struct slowpath_args args;

args.fmt = fmt;
va_start(args.args, fmt);
warn_slowpath_common(file, line, __builtin_return_address(0), &args);
va_end(args.args);
}
EXPORT_SYMBOL(warn_slowpath_fmt);

void warn_slowpath_null(const char *file, int line)
{
static const char *empty = "";
warn_slowpath_fmt(file, line, empty);
warn_slowpath_common(file, line, __builtin_return_address(0), NULL);
}
EXPORT_SYMBOL(warn_slowpath_null);
#endif
Expand Down

0 comments on commit e343a6e

Please sign in to comment.