From patchwork Fri Jul 25 20:05:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 34319 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4A88235AB for ; Fri, 25 Jul 2014 20:08:28 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id 29sf16575665yhl.2 for ; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe :content-transfer-encoding; bh=j2ElXSDok6c9M8LBYwKs2wLIlapyBzZ23/Lj47bp8lM=; b=TjF4BBbNzpmmyPoQiD6MDy0fATg+HhHwZU26dDyXPyEI0+pe5BfthJ0geXR+GFY52t rD0+Qk8Pvfwi9BOVKMEqqjTlGRDeiXHAwDXTg2YqoPKxlh7bfsusHKFHzuZrbiQ1tPVS jMNi9G1Bk4ZDOsojNz5wnI98BRlvMRqipnUlUgvnV4tGPH0s9v7wh4qgc4tvoRkXJwyQ MC2HhtOJp/rpKgzaymQnFprcYl4gUDGB5X/vzaR3Vcisgp6fjxQg5jtZg927AYsiUtAo NrDSfglRBQjLsVDnEZyJAp/qgi8WRiGS50J5WY2z56KiErl2JQv28vIoCXwvDVTdfc9M 7ojA== X-Gm-Message-State: ALoCoQlab0cZnATF3IIuQRy/GFW7JmJ7JtyYtCLcpEsAZm6ovOxqYN0YkpyEMoA8Ll3NtJSIzM1z X-Received: by 10.236.69.138 with SMTP id n10mr6758714yhd.49.1406318908528; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.17 with SMTP id z17ls1310270qge.74.gmail; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) X-Received: by 10.220.114.5 with SMTP id c5mr24058118vcq.28.1406318908407; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id n9si8230754vcx.91.2014.07.25.13.08.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 13:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so8290284vcb.12 for ; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) X-Received: by 10.220.50.8 with SMTP id x8mr23594180vcf.18.1406318908317; Fri, 25 Jul 2014 13:08:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp63062vcb; Fri, 25 Jul 2014 13:08:27 -0700 (PDT) X-Received: by 10.70.61.103 with SMTP id o7mr21261292pdr.134.1406318907435; Fri, 25 Jul 2014 13:08:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id is1si10216154pbc.133.2014.07.25.13.08.26 for ; Fri, 25 Jul 2014 13:08:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935308AbaGYUIX (ORCPT + 16 others); Fri, 25 Jul 2014 16:08:23 -0400 Received: from relais.videotron.ca ([24.201.245.36]:13726 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935223AbaGYUHh (ORCPT ); Fri, 25 Jul 2014 16:07:37 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR003.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N9A00LZZAKLDMA0@VL-VM-MR003.ip.videotron.ca> for linux-kernel@vger.kernel.org; Fri, 25 Jul 2014 16:07:33 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 99CFA2DA0419; Fri, 25 Jul 2014 16:07:33 -0400 (EDT) From: Nicolas Pitre To: Steven Rostedt , Ingo Molnar Cc: Daniel Lezcano , Russell King - ARM Linux , Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org Subject: [PATCH v2 5/5] X86: add IPI tracepoints Date: Fri, 25 Jul 2014 16:05:33 -0400 Message-id: <1406318733-26754-6-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1406318733-26754-1-git-send-email-nicolas.pitre@linaro.org> References: <1406318733-26754-1-git-send-email-nicolas.pitre@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT 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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index be8e1bde07..d193609bea 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -31,6 +31,16 @@ #include #include #include + +#define CREATE_TRACE_POINTS +/* + * Those were defined in and cause problems + * when including . + */ +#undef TRACE_INCLUDE_PATH +#undef TRACE_INCLUDE_FILE +#include + /* * Some notes on x86 processor bugs affecting SMP operation: * @@ -124,11 +134,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 +148,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 +266,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 +307,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 +331,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)