]> xenbits.xensource.com Git - people/jgross/linux.git/commitdiff
sched, smp: Trace IPIs sent via send_call_function_single_ipi()
authorValentin Schneider <vschneid@redhat.com>
Tue, 7 Mar 2023 14:35:53 +0000 (14:35 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 24 Mar 2023 10:01:27 +0000 (11:01 +0100)
send_call_function_single_ipi() is the thing that sends IPIs at the bottom
of smp_call_function*() via either generic_exec_single() or
smp_call_function_many_cond(). Give it an IPI-related tracepoint.

Note that this ends up tracing any IPI sent via __smp_call_single_queue(),
which covers __ttwu_queue_wakelist() and irq_work_queue_on() "for free".

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>
Acked-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230307143558.294354-3-vschneid@redhat.com
arch/arm/kernel/smp.c
arch/arm64/kernel/smp.c
kernel/sched/core.c
kernel/smp.c

index 0b8c25763adc3810fcfa99465a97718be6e7f7e7..5edf09237b2f07f10b44c32bcd386bbca389fb0e 100644 (file)
@@ -48,7 +48,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mpu.h>
 
-#define CREATE_TRACE_POINTS
 #include <trace/events/ipi.h>
 
 /*
index 4e832726425521d2def157041b1471218f454347..438c16fc44633ac87e71a829a646876d1946e9b0 100644 (file)
@@ -51,7 +51,6 @@
 #include <asm/ptrace.h>
 #include <asm/virt.h>
 
-#define CREATE_TRACE_POINTS
 #include <trace/events/ipi.h>
 
 DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number);
index 488655f2319f5d7660be0772e6aafb1fc1a0e80a..c26a2cd99ec7b7a4a259eb89255c27563caee6fc 100644 (file)
@@ -80,6 +80,7 @@
 #define CREATE_TRACE_POINTS
 #include <linux/sched/rseq_api.h>
 #include <trace/events/sched.h>
+#include <trace/events/ipi.h>
 #undef CREATE_TRACE_POINTS
 
 #include "sched.h"
@@ -95,6 +96,8 @@
 #include "../../io_uring/io-wq.h"
 #include "../smpboot.h"
 
+EXPORT_TRACEPOINT_SYMBOL_GPL(ipi_send_cpumask);
+
 /*
  * Export tracepoints that act as a bare tracehook (ie: have no trace event
  * associated with them) to allow external modules to probe them.
@@ -3830,10 +3833,12 @@ void send_call_function_single_ipi(int cpu)
 {
        struct rq *rq = cpu_rq(cpu);
 
-       if (!set_nr_if_polling(rq->idle))
+       if (!set_nr_if_polling(rq->idle)) {
+               trace_ipi_send_cpumask(cpumask_of(cpu), _RET_IP_, NULL);
                arch_send_call_function_single_ipi(cpu);
-       else
+       } else {
                trace_sched_wake_idle_without_ipi(cpu);
+       }
 }
 
 /*
index 298ba7570621fcedf9f92ec8fc6fe4f52a6cf804..770e879a727481f639a804ef1ca67510bf3e3583 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/sched/debug.h>
 #include <linux/jump_label.h>
 
+#include <trace/events/ipi.h>
+
 #include "smpboot.h"
 #include "sched/smp.h"