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: 33815 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F321320969 for ; Fri, 18 Jul 2014 05:21:11 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id b6sf9052511yha.9 for ; Thu, 17 Jul 2014 22:21:11 -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=tnP68Gw51SywgXmQ8xjDP1JLl0EnvqMsPL/ZC4LnpoA=; b=AQImPa3oAbHVMzr0NbnNVtKXW9yvIE/EiSKv2fKy6L4FxLh68t1zCmy5oZO0AsAeyt H/2eoJVp8PiotEj8+oV6ydh1POxTf5jwoPkNd2156ctcNuNWZJUb8rtqfXRIJ+/mHcW9 vdETsdRZNtBaTW0wyUKfEF5kNV5ihQtE6k9AIKt+BAfYoXvaXvYPpHG9Jx4gBDkDIECO tYd+SyNW0R37w7nsezNgNfoKti2OLbtErRN0DbYPHPCe5fXEu40BQ9EjdU9VSqjVFhQ/ CeMUf9k22Aindf48sHsIaYvKi8LISEuqyS32j5+6rtAduckrnUujrhuU90iP48WsvoA6 hh9w== X-Gm-Message-State: ALoCoQntd1LZ0KKJfcyP1ViUuQNNM6SQl5SOTuxXu3+i1Brdz3l8G5zldrQ4CdNAl4Z68mnnBakJ X-Received: by 10.236.206.51 with SMTP id k39mr990896yho.23.1405660871616; Thu, 17 Jul 2014 22:21:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.226 with SMTP id r89ls24248qgd.44.gmail; Thu, 17 Jul 2014 22:21:11 -0700 (PDT) X-Received: by 10.52.88.74 with SMTP id be10mr1700546vdb.54.1405660871440; Thu, 17 Jul 2014 22:21:11 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id rw10si4773886vcb.44.2014.07.17.22.21.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jul 2014 22:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so4956716vcb.24 for ; Thu, 17 Jul 2014 22:21:11 -0700 (PDT) X-Received: by 10.220.68.140 with SMTP id v12mr1901177vci.13.1405660871344; Thu, 17 Jul 2014 22:21:11 -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 tc5csp91906vcb; Thu, 17 Jul 2014 22:21:10 -0700 (PDT) X-Received: by 10.70.46.228 with SMTP id y4mr211593pdm.166.1405660870460; Thu, 17 Jul 2014 22:21:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ro4si3981139pac.2.2014.07.17.22.21.09; Thu, 17 Jul 2014 22:21:09 -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 S933873AbaGRFU7 (ORCPT + 24 others); Fri, 18 Jul 2014 01:20:59 -0400 Received: from relais.videotron.ca ([24.201.245.36]:62580 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932868AbaGRFUg (ORCPT ); Fri, 18 Jul 2014 01:20:36 -0400 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-kernel@vger.kernel.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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org 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> 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.179 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 | 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)