stacktrace.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/ptrace.h>
  9. #include <linux/export.h>
  10. /*-------------------------------------------------------------------------
  11. * APIs expected by various kernel sub-systems
  12. *-------------------------------------------------------------------------
  13. */
  14. noinline void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs)
  15. {
  16. pr_info("\nStack Trace: NOT Available\n");
  17. }
  18. EXPORT_SYMBOL(show_stacktrace);
  19. /* Expected by sched Code */
  20. void show_stack(struct task_struct *tsk, unsigned long *sp)
  21. {
  22. show_stacktrace(tsk, NULL);
  23. }
  24. /* Expected by Rest of kernel code */
  25. void dump_stack(void)
  26. {
  27. show_stacktrace(NULL, NULL);
  28. }
  29. EXPORT_SYMBOL(dump_stack);
  30. /* Another API expected by schedular, shows up in "ps" as Wait Channel
  31. * Ofcourse just returning schedule( ) would be pointless so unwind until
  32. * the function is not in schedular code
  33. */
  34. unsigned int get_wchan(struct task_struct *tsk)
  35. {
  36. return 0;
  37. }