From patchwork Fri Aug 8 14:32:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 35132 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E9DB021457 for ; Fri, 8 Aug 2014 14:38:24 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf5625216pde.2 for ; Fri, 08 Aug 2014 07:38:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:user-agent:date:from:to :cc:subject:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-disposition; bh=gDTfLLL4d7cuohz4chslGv13Qa6IFCwgN7/RjUaUIUo=; b=W+DPNfETWrzLt8dky2th54uiSqyp05TEr49ukkl1fdgMgXfbePgnDQgdU3sUKKZ531 JL4tDznDILpJhmdJfb5mlw/NNvLrlq7stBjXrvYBI81J+n0bl2CcPLNReY89c5SZdGev wV6LIuXTvLf6cV72zkuynO5UmsK+ErfvULjlfwqu+AWkcaMTUsqzlc+QYeDX3c1dZ7i+ qKv5Qqun/ZRuuh4PHPErDeCnF9cqWB1mPTIVhY2YQdfNXA6ib66yK9hiAOBozc8E6CrR 83Q1yygF3d1HlEk/x0ir/MBkjbG92FFXEvGXLXzcsQQaklVlCvQLuLvkWdlGbgq29oIm 2NwQ== X-Gm-Message-State: ALoCoQkk1USa24aUjttZdymksEm41EEJTdQ/BQsE8oy4YAAUP54VSsjUYGbFMiwfbg/3rCP+QNAf X-Received: by 10.67.3.225 with SMTP id bz1mr13216048pad.16.1407508704255; Fri, 08 Aug 2014 07:38:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.18 with SMTP id z18ls521940qge.0.gmail; Fri, 08 Aug 2014 07:38:24 -0700 (PDT) X-Received: by 10.52.175.130 with SMTP id ca2mr173413vdc.94.1407508704104; Fri, 08 Aug 2014 07:38:24 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id sq19si2939594vdb.44.2014.08.08.07.38.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 07:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so8552726vcb.13 for ; Fri, 08 Aug 2014 07:38:24 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr22360386vcn.16.1407508703971; Fri, 08 Aug 2014 07:38:23 -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 tc5csp128342vcb; Fri, 8 Aug 2014 07:38:23 -0700 (PDT) X-Received: by 10.68.203.67 with SMTP id ko3mr1929678pbc.160.1407508702638; Fri, 08 Aug 2014 07:38:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ov6si2644661pdb.237.2014.08.08.07.38.22 for ; Fri, 08 Aug 2014 07:38:22 -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 S1757002AbaHHOhR (ORCPT + 26 others); Fri, 8 Aug 2014 10:37:17 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:33154 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756978AbaHHOhM (ORCPT ); Fri, 8 Aug 2014 10:37:12 -0400 Received: from [67.246.153.56] ([67.246.153.56:52842] helo=gandalf.local.home) by cdptpa-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 95/34-18071-690E4E35; Fri, 08 Aug 2014 14:37:10 +0000 Received: from rostedt by gandalf.local.home with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XFlI6-00087g-DK; Fri, 08 Aug 2014 10:37:10 -0400 Message-Id: <20140808143710.343996554@goodmis.org> User-Agent: quilt/0.61-1 Date: Fri, 08 Aug 2014 10:32:58 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Ingo Molnar , Andrew Morton , Nicolas Pitre , Will Deacon , Catalin Marinas , Russell King - ARM Linux Subject: [PATCH 4/4] ARM64: add IPI tracepoints References: <20140808143254.145903999@goodmis.org> MIME-Version: 1.0 X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 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: rostedt@goodmis.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.182 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-Disposition: inline; filename=0004-ARM64-add-IPI-tracepoints.patch From: Nicolas Pitre The strings used to list IPIs in /proc/interrupts are reused for tracing purposes. While at it, the code is slightly cleaned up so the ipi_types array indices are no longer offset by IPI_RESCHEDULE whose value is 0 anyway. Link: http://lkml.kernel.org/p/1406318733-26754-5-git-send-email-nicolas.pitre@linaro.org Acked-by: Will Deacon Acked-by: Catalin Marinas Signed-off-by: Nicolas Pitre Signed-off-by: Steven Rostedt --- arch/arm64/kernel/smp.c | 65 +++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 40f38f46c8e0..a89c66f3b4c5 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -50,6 +50,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + /* * as from 2.5, kernels no longer have an init_tasks structure * so we need some other way of telling a new secondary core @@ -307,8 +310,6 @@ void __init smp_prepare_boot_cpu(void) set_my_cpu_offset(per_cpu_offset(smp_processor_id())); } -static void (*smp_cross_call)(const struct cpumask *, unsigned int); - /* * Enumerate the possible CPU set from the device tree and build the * cpu logical map array containing MPIDR values related to logical @@ -463,32 +464,15 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } +static void (*__smp_cross_call)(const struct cpumask *, unsigned int); void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int)) { - smp_cross_call = fn; + __smp_cross_call = fn; } -void arch_send_call_function_ipi_mask(const struct cpumask *mask) -{ - smp_cross_call(mask, IPI_CALL_FUNC); -} - -void arch_send_call_function_single_ipi(int cpu) -{ - smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); -} - -#ifdef CONFIG_IRQ_WORK -void arch_irq_work_raise(void) -{ - if (smp_cross_call) - smp_cross_call(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); -} -#endif - -static const char *ipi_types[NR_IPI] = { -#define S(x,s) [x - IPI_RESCHEDULE] = s +static const char *ipi_types[NR_IPI] __tracepoint_string = { +#define S(x,s) [x] = s S(IPI_RESCHEDULE, "Rescheduling interrupts"), S(IPI_CALL_FUNC, "Function call interrupts"), S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"), @@ -497,12 +481,18 @@ static const char *ipi_types[NR_IPI] = { S(IPI_IRQ_WORK, "IRQ work interrupts"), }; +static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) +{ + trace_ipi_raise(target, ipi_types[ipinr]); + __smp_cross_call(target, ipinr); +} + void show_ipi_list(struct seq_file *p, int prec) { unsigned int cpu, i; for (i = 0; i < NR_IPI; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i + IPI_RESCHEDULE, + seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " : ""); for_each_online_cpu(cpu) seq_printf(p, "%10u ", @@ -522,6 +512,24 @@ u64 smp_irq_stat_cpu(unsigned int cpu) return sum; } +void arch_send_call_function_ipi_mask(const struct cpumask *mask) +{ + smp_cross_call(mask, IPI_CALL_FUNC); +} + +void arch_send_call_function_single_ipi(int cpu) +{ + smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); +} + +#ifdef CONFIG_IRQ_WORK +void arch_irq_work_raise(void) +{ + if (__smp_cross_call) + smp_cross_call(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); +} +#endif + static DEFINE_RAW_SPINLOCK(stop_lock); /* @@ -553,8 +561,10 @@ void handle_IPI(int ipinr, struct pt_regs *regs) unsigned int cpu = smp_processor_id(); struct pt_regs *old_regs = set_irq_regs(regs); - if (ipinr >= IPI_RESCHEDULE && ipinr < IPI_RESCHEDULE + NR_IPI) - __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_RESCHEDULE]); + if ((unsigned)ipinr < NR_IPI) { + trace_ipi_entry(ipi_types[ipinr]); + __inc_irq_stat(cpu, ipi_irqs[ipinr]); + } switch (ipinr) { case IPI_RESCHEDULE: @@ -599,6 +609,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs) pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr); break; } + + if ((unsigned)ipinr < NR_IPI) + trace_ipi_exit(ipi_types[ipinr]); set_irq_regs(old_regs); }