2006-07-03 07:24:38 +00:00
|
|
|
/*
|
|
|
|
* kernel/stacktrace.c
|
|
|
|
*
|
|
|
|
* Stack trace management functions
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
|
|
|
|
*/
|
|
|
|
#include <linux/sched.h>
|
2008-06-27 19:20:17 +00:00
|
|
|
#include <linux/module.h>
|
2006-07-03 07:24:38 +00:00
|
|
|
#include <linux/kallsyms.h>
|
|
|
|
#include <linux/stacktrace.h>
|
|
|
|
|
|
|
|
void print_stack_trace(struct stack_trace *trace, int spaces)
|
|
|
|
{
|
2008-06-13 09:00:14 +00:00
|
|
|
int i;
|
2006-07-03 07:24:38 +00:00
|
|
|
|
2008-05-12 19:21:14 +00:00
|
|
|
if (WARN_ON(!trace->entries))
|
|
|
|
return;
|
|
|
|
|
2006-07-03 07:24:38 +00:00
|
|
|
for (i = 0; i < trace->nr_entries; i++) {
|
2008-06-13 09:00:14 +00:00
|
|
|
printk("%*c", 1 + spaces, ' ');
|
|
|
|
print_ip_sym(trace->entries[i]);
|
2006-07-03 07:24:38 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-27 19:20:17 +00:00
|
|
|
EXPORT_SYMBOL_GPL(print_stack_trace);
|
2006-07-03 07:24:38 +00:00
|
|
|
|