trace.c 596 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Tracepoint definitions for s390
  3. *
  4. * Copyright IBM Corp. 2015
  5. * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  6. */
  7. #include <linux/percpu.h>
  8. #define CREATE_TRACE_POINTS
  9. #include <asm/trace/diag.h>
  10. EXPORT_TRACEPOINT_SYMBOL(s390_diagnose);
  11. static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth);
  12. void trace_s390_diagnose_norecursion(int diag_nr)
  13. {
  14. unsigned long flags;
  15. unsigned int *depth;
  16. local_irq_save(flags);
  17. depth = this_cpu_ptr(&diagnose_trace_depth);
  18. if (*depth == 0) {
  19. (*depth)++;
  20. trace_s390_diagnose(diag_nr);
  21. (*depth)--;
  22. }
  23. local_irq_restore(flags);
  24. }