ftrace.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright 2012 Google, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/compiler.h>
  15. #include <linux/irqflags.h>
  16. #include <linux/percpu.h>
  17. #include <linux/smp.h>
  18. #include <linux/atomic.h>
  19. #include <asm/barrier.h>
  20. #include "internal.h"
  21. void notrace pstore_ftrace_call(unsigned long ip, unsigned long parent_ip)
  22. {
  23. struct pstore_ftrace_record rec = {};
  24. if (unlikely(oops_in_progress))
  25. return;
  26. rec.ip = ip;
  27. rec.parent_ip = parent_ip;
  28. pstore_ftrace_encode_cpu(&rec, raw_smp_processor_id());
  29. psinfo->write_buf(PSTORE_TYPE_FTRACE, 0, NULL, 0, (void *)&rec,
  30. sizeof(rec), psinfo);
  31. }