stacktrace.c 462 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, j;
  14. for (i = 0; i < trace->nr_entries; i++) {
  15. unsigned long ip = trace->entries[i];
  16. for (j = 0; j < spaces + 1; j++)
  17. printk(" ");
  18. print_ip_sym(ip);
  19. }
  20. }