trace.c 671 B

123456789101112131415161718192021222324252627282930313233
  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. /* Avoid lockdep recursion. */
  17. if (IS_ENABLED(CONFIG_LOCKDEP))
  18. return;
  19. local_irq_save(flags);
  20. depth = this_cpu_ptr(&diagnose_trace_depth);
  21. if (*depth == 0) {
  22. (*depth)++;
  23. trace_s390_diagnose(diag_nr);
  24. (*depth)--;
  25. }
  26. local_irq_restore(flags);
  27. }