perf_callchain.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Performance event callchain support - SuperH architecture code
  3. *
  4. * Copyright (C) 2009 Paul Mundt
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/sched.h>
  12. #include <linux/perf_event.h>
  13. #include <linux/percpu.h>
  14. #include <asm/unwinder.h>
  15. #include <asm/ptrace.h>
  16. static void callchain_warning(void *data, char *msg)
  17. {
  18. }
  19. static void
  20. callchain_warning_symbol(void *data, char *msg, unsigned long symbol)
  21. {
  22. }
  23. static int callchain_stack(void *data, char *name)
  24. {
  25. return 0;
  26. }
  27. static void callchain_address(void *data, unsigned long addr, int reliable)
  28. {
  29. struct perf_callchain_entry *entry = data;
  30. if (reliable)
  31. perf_callchain_store(entry, addr);
  32. }
  33. static const struct stacktrace_ops callchain_ops = {
  34. .warning = callchain_warning,
  35. .warning_symbol = callchain_warning_symbol,
  36. .stack = callchain_stack,
  37. .address = callchain_address,
  38. };
  39. void
  40. perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs)
  41. {
  42. perf_callchain_store(entry, regs->pc);
  43. unwind_stack(NULL, regs, NULL, &callchain_ops, entry);
  44. }