Commit cc9cb0a7 authored by Valentin Schneider's avatar Valentin Schneider Committed by Peter Zijlstra
Browse files

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: default avatarValentin Schneider <vschneid@redhat.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230307143558.294354-3-vschneid@redhat.com
parent 56eb0598
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#include <asm/mach/arch.h>
#include <asm/mpu.h>

#define CREATE_TRACE_POINTS
#include <trace/events/ipi.h>

/*
+0 −1
Original line number Diff line number Diff line
@@ -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);
+7 −2
Original line number Diff line number Diff line
@@ -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,11 +3833,13 @@ 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);
	}
}

/*
 * Queue a task on the target CPUs wake_list and wake the CPU via IPI if
+2 −0
Original line number Diff line number Diff line
@@ -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"