From patchwork Fri Jul 18 05:18:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 4580411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DD7EC0514 for ; Fri, 18 Jul 2014 05:24:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 397DB20176 for ; Fri, 18 Jul 2014 05:24:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D5C62017D for ; Fri, 18 Jul 2014 05:24:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X80bq-0007CJ-Qb; Fri, 18 Jul 2014 05:21:30 +0000 Received: from relais.videotron.ca ([24.201.245.36]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X80bP-000721-7I for linux-arm-kernel@lists.infradead.org; Fri, 18 Jul 2014 05:21:03 +0000 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR001.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N8W00MUT6U90970@VL-VM-MR001.ip.videotron.ca> for linux-arm-kernel@lists.infradead.org; Fri, 18 Jul 2014 01:20:33 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 9D2552DA08D3; Fri, 18 Jul 2014 01:20:33 -0400 (EDT) From: Nicolas Pitre To: Steven Rostedt , Ingo Molnar , Daniel Lezcano , Russell King - ARM Linux , Catalin Marinas Subject: [PATCH 4/4] (RFC) X86: add IPI tracepoints Date: Fri, 18 Jul 2014 01:18:55 -0400 Message-id: <1405660735-13408-5-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1405660735-13408-1-git-send-email-nicolas.pitre@linaro.org> References: <1405660735-13408-1-git-send-email-nicolas.pitre@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140717_222103_337933_CF7E8B63 X-CRM114-Status: GOOD ( 13.79 ) X-Spam-Score: -0.0 (/) Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include #include + +#define CREATE_TRACE_POINTS +#undef TRACE_INCLUDE_PATH +#undef TRACE_INCLUDE_FILE +#include + /* * 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)