Skip to content

Commit cc9cb0a

Browse files
valschneiderPeter Zijlstra
authored andcommitted
sched, smp: Trace IPIs sent via send_call_function_single_ipi()
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
1 parent 56eb059 commit cc9cb0a

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

arch/arm/kernel/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <asm/mach/arch.h>
4949
#include <asm/mpu.h>
5050

51-
#define CREATE_TRACE_POINTS
5251
#include <trace/events/ipi.h>
5352

5453
/*

arch/arm64/kernel/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#include <asm/ptrace.h>
5252
#include <asm/virt.h>
5353

54-
#define CREATE_TRACE_POINTS
5554
#include <trace/events/ipi.h>
5655

5756
DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number);

kernel/sched/core.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define CREATE_TRACE_POINTS
8181
#include <linux/sched/rseq_api.h>
8282
#include <trace/events/sched.h>
83+
#include <trace/events/ipi.h>
8384
#undef CREATE_TRACE_POINTS
8485

8586
#include "sched.h"
@@ -95,6 +96,8 @@
9596
#include "../../io_uring/io-wq.h"
9697
#include "../smpboot.h"
9798

99+
EXPORT_TRACEPOINT_SYMBOL_GPL(ipi_send_cpumask);
100+
98101
/*
99102
* Export tracepoints that act as a bare tracehook (ie: have no trace event
100103
* associated with them) to allow external modules to probe them.
@@ -3830,10 +3833,12 @@ void send_call_function_single_ipi(int cpu)
38303833
{
38313834
struct rq *rq = cpu_rq(cpu);
38323835

3833-
if (!set_nr_if_polling(rq->idle))
3836+
if (!set_nr_if_polling(rq->idle)) {
3837+
trace_ipi_send_cpumask(cpumask_of(cpu), _RET_IP_, NULL);
38343838
arch_send_call_function_single_ipi(cpu);
3835-
else
3839+
} else {
38363840
trace_sched_wake_idle_without_ipi(cpu);
3841+
}
38373842
}
38383843

38393844
/*

kernel/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <linux/sched/debug.h>
2727
#include <linux/jump_label.h>
2828

29+
#include <trace/events/ipi.h>
30+
2931
#include "smpboot.h"
3032
#include "sched/smp.h"
3133

0 commit comments

Comments
 (0)