hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/kernel/trace/trace.c
....@@ -1129,9 +1129,9 @@
11291129 return;
11301130 }
11311131
1132
- local_irq_save(flags);
1132
+ flags = hard_local_irq_save();
11331133 update_max_tr(tr, current, smp_processor_id(), cond_data);
1134
- local_irq_restore(flags);
1134
+ hard_local_irq_restore(flags);
11351135 }
11361136
11371137 void tracing_snapshot_instance(struct trace_array *tr)
....@@ -1822,7 +1822,7 @@
18221822 if (tr->stop_count)
18231823 return;
18241824
1825
- WARN_ON_ONCE(!irqs_disabled());
1825
+ WARN_ON_ONCE(!hard_irqs_disabled());
18261826
18271827 if (!tr->allocated_snapshot) {
18281828 /* Only the nop tracer should hit this when disabling */
....@@ -1866,7 +1866,7 @@
18661866 if (tr->stop_count)
18671867 return;
18681868
1869
- WARN_ON_ONCE(!irqs_disabled());
1869
+ WARN_ON_ONCE(!hard_irqs_disabled());
18701870 if (!tr->allocated_snapshot) {
18711871 /* Only the nop tracer should hit this when disabling */
18721872 WARN_ON_ONCE(tr->current_trace != &nop_trace);
....@@ -2626,12 +2626,14 @@
26262626 entry->flags =
26272627 #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
26282628 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
2629
-#else
2629
+ (hard_irqs_disabled() ? TRACE_FLAG_IRQS_HARDOFF : 0) |
2630
+#elif !defined(CONFIG_IRQ_PIPELINE)
26302631 TRACE_FLAG_IRQS_NOSUPPORT |
26312632 #endif
26322633 ((pc & NMI_MASK ) ? TRACE_FLAG_NMI : 0) |
26332634 ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
26342635 ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) |
2636
+ (running_oob() ? TRACE_FLAG_OOB_STAGE : 0) |
26352637 (tif_need_resched() ? TRACE_FLAG_NEED_RESCHED : 0) |
26362638 (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0);
26372639 }
....@@ -7085,13 +7087,13 @@
70857087 ret = tracing_alloc_snapshot_instance(tr);
70867088 if (ret < 0)
70877089 break;
7088
- local_irq_disable();
7090
+ hard_local_irq_disable();
70897091 /* Now, we're going to swap */
70907092 if (iter->cpu_file == RING_BUFFER_ALL_CPUS)
70917093 update_max_tr(tr, current, smp_processor_id(), NULL);
70927094 else
70937095 update_max_tr_single(tr, current, iter->cpu_file);
7094
- local_irq_enable();
7096
+ hard_local_irq_enable();
70957097 break;
70967098 default:
70977099 if (tr->allocated_snapshot) {