stacktrace.c 458 B

123456789101112131415161718192021222324
  1. /*
  2. * kernel/stacktrace.c
  3. *
  4. * Stack trace management functions
  5. *
  6. * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
  7. */
  8. #include <linux/sched.h>
  9. #include <linux/kallsyms.h>
  10. #include <linux/stacktrace.h>
  11. void print_stack_trace(struct stack_trace *trace, int spaces)
  12. {
  13. int i;
  14. if (WARN_ON(!trace->entries))
  15. return;
  16. for (i = 0; i < trace->nr_entries; i++) {
  17. printk("%*c", 1 + spaces, ' ');
  18. print_ip_sym(trace->entries[i]);
  19. }
  20. }