0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/percpu.h>
0010 #define CREATE_TRACE_POINTS
0011 #include <asm/trace/diag.h>
0012
0013 EXPORT_TRACEPOINT_SYMBOL(s390_diagnose);
0014
0015 static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth);
0016
0017 void notrace trace_s390_diagnose_norecursion(int diag_nr)
0018 {
0019 unsigned long flags;
0020 unsigned int *depth;
0021
0022
0023 if (IS_ENABLED(CONFIG_LOCKDEP))
0024 return;
0025 local_irq_save(flags);
0026 depth = this_cpu_ptr(&diagnose_trace_depth);
0027 if (*depth == 0) {
0028 (*depth)++;
0029 trace_s390_diagnose(diag_nr);
0030 (*depth)--;
0031 }
0032 local_irq_restore(flags);
0033 }