Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irq_work: Trace self-IPIs sent via arch_irq_work_raise()

IPIs sent to remote CPUs via irq_work_queue_on() are now covered by
trace_ipi_send_cpumask(), add another instance of the tracepoint to cover
self-IPIs.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20230307143558.294354-5-vschneid@redhat.com

authored by

Valentin Schneider and committed by
Peter Zijlstra
4468161a 08407b5f

+13 -1
+13 -1
kernel/irq_work.c
··· 22 22 #include <asm/processor.h> 23 23 #include <linux/kasan.h> 24 24 25 + #include <trace/events/ipi.h> 26 + 25 27 static DEFINE_PER_CPU(struct llist_head, raised_list); 26 28 static DEFINE_PER_CPU(struct llist_head, lazy_list); 27 29 static DEFINE_PER_CPU(struct task_struct *, irq_workd); ··· 76 74 */ 77 75 } 78 76 77 + static __always_inline void irq_work_raise(struct irq_work *work) 78 + { 79 + if (trace_ipi_send_cpumask_enabled() && arch_irq_work_has_interrupt()) 80 + trace_ipi_send_cpumask(cpumask_of(smp_processor_id()), 81 + _RET_IP_, 82 + work->func); 83 + 84 + arch_irq_work_raise(); 85 + } 86 + 79 87 /* Enqueue on current CPU, work must already be claimed and preempt disabled */ 80 88 static void __irq_work_queue_local(struct irq_work *work) 81 89 { ··· 111 99 112 100 /* If the work is "lazy", handle it from next tick if any */ 113 101 if (!lazy_work || tick_nohz_tick_stopped()) 114 - arch_irq_work_raise(); 102 + irq_work_raise(work); 115 103 } 116 104 117 105 /* Enqueue the irq work @work on the current CPU */