From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] (RFC) X86: add IPI tracepoints
Date: Fri, 18 Jul 2014 01:18:55 -0400 [thread overview]
Message-ID: <1405660735-13408-5-git-send-email-nicolas.pitre@linaro.org> (raw)
In-Reply-To: <1405660735-13408-1-git-send-email-nicolas.pitre@linaro.org>
On X86 there are already tracepoints for IRQ vectors through which IPIs
are handled. However this is highly X86 specific, and the IPI signaling
is not currently traced.
This is an attempt at adding generic IPI tracepoints to X86.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
arch/x86/kernel/smp.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index be8e1bde07..e154d176cf 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -31,6 +31,12 @@
#include <asm/apic.h>
#include <asm/nmi.h>
#include <asm/trace/irq_vectors.h>
+
+#define CREATE_TRACE_POINTS
+#undef TRACE_INCLUDE_PATH
+#undef TRACE_INCLUDE_FILE
+#include <trace/events/ipi.h>
+
/*
* Some notes on x86 processor bugs affecting SMP operation:
*
@@ -124,11 +130,13 @@ static void native_smp_send_reschedule(int cpu)
WARN_ON(1);
return;
}
+ trace_ipi_raise(cpumask_of(cpu), tracepoint_string("RESCHEDULE"));
apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
}
void native_send_call_func_single_ipi(int cpu)
{
+ trace_ipi_raise(cpumask_of(cpu), tracepoint_string("CALL_FUNCTION_SINGLE"));
apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
}
@@ -136,6 +144,8 @@ void native_send_call_func_ipi(const struct cpumask *mask)
{
cpumask_var_t allbutself;
+ trace_ipi_raise(mask, tracepoint_string("CALL_FUNCTION"));
+
if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
return;
@@ -252,8 +262,10 @@ finish:
*/
static inline void __smp_reschedule_interrupt(void)
{
+ trace_ipi_entry(tracepoint_string("RESCHEDULE"));
inc_irq_stat(irq_resched_count);
scheduler_ipi();
+ trace_ipi_exit(tracepoint_string("RESCHEDULE"));
}
__visible void smp_reschedule_interrupt(struct pt_regs *regs)
@@ -291,8 +303,10 @@ __visible void smp_trace_reschedule_interrupt(struct pt_regs *regs)
static inline void __smp_call_function_interrupt(void)
{
+ trace_ipi_entry(tracepoint_string("CALL_FUNCTION"));
generic_smp_call_function_interrupt();
inc_irq_stat(irq_call_count);
+ trace_ipi_exit(tracepoint_string("CALL_FUNCTION"));
}
__visible void smp_call_function_interrupt(struct pt_regs *regs)
@@ -313,8 +327,10 @@ __visible void smp_trace_call_function_interrupt(struct pt_regs *regs)
static inline void __smp_call_function_single_interrupt(void)
{
+ trace_ipi_entry(tracepoint_string("CALL_FUNCTION_SINGLE"));
generic_smp_call_function_single_interrupt();
inc_irq_stat(irq_call_count);
+ trace_ipi_exit(tracepoint_string("CALL_FUNCTION_SINGLE"));
}
__visible void smp_call_function_single_interrupt(struct pt_regs *regs)
--
1.8.4.108.g55ea5f6
next prev parent reply other threads:[~2014-07-18 5:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 5:18 [PATCH 0/4] basic IPI tracing Nicolas Pitre
2014-07-18 5:18 ` [PATCH 1/4] tracepoint: add generic tracepoint definitions for " Nicolas Pitre
2014-07-23 13:24 ` Daniel Lezcano
2014-07-18 5:18 ` [PATCH 2/4] ARM: add IPI tracepoints Nicolas Pitre
2014-07-18 20:04 ` Steven Rostedt
2014-07-18 20:55 ` Nicolas Pitre
2014-07-18 21:22 ` Steven Rostedt
2014-07-19 2:55 ` Nicolas Pitre
2014-07-19 3:30 ` Steven Rostedt
2014-07-19 19:10 ` Ard Biesheuvel
2014-07-19 20:28 ` Steven Rostedt
2014-07-19 20:50 ` Ard Biesheuvel
2014-07-19 21:56 ` Steven Rostedt
2014-07-19 21:59 ` Nicolas Pitre
2014-07-23 22:18 ` Nicolas Pitre
2014-07-18 5:18 ` [PATCH 3/4] ARM64: " Nicolas Pitre
2014-07-21 10:36 ` Catalin Marinas
2014-07-18 5:18 ` Nicolas Pitre [this message]
2014-07-18 20:27 ` [PATCH 4/4] (RFC) X86: " Steven Rostedt
2014-07-18 20:59 ` Nicolas Pitre
2014-07-21 22:54 ` Steven Rostedt
2014-07-23 22:00 ` Nicolas Pitre
2014-07-20 20:25 ` Davidlohr Bueso
2014-07-21 22:35 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405660735-13408-5-git-send-email-nicolas.pitre@linaro.org \
--to=nicolas.pitre@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).