From patchwork Wed Jul 23 22:18:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 34178 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3090420672 for ; Wed, 23 Jul 2014 22:18:42 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m1sf11508742oag.11 for ; Wed, 23 Jul 2014 15:18:41 -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:date:from:to:cc:subject:in-reply-to :message-id:references:user-agent: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; bh=2FQn2PkSF5hNDSj6DkiNEYH6QeNfyJm28R6N+r46vws=; b=LoPmkzeRRyeWllf4/v2c2hzCgpwuskYYPLoz9s4bXsDe6iImzZKpu6xVyZKbBDyS0Q Ty6QgLq25gkziWFM7N98zxa4EvYk4a8Bauhk08pZARL4+MCZIcgnZofQzJEqCZy2Pt9b o/ULL3iieKRFexi9ZgDciOkO0jPibE8UbZvGuKulfxXCuBdGI3PmOdLenk0+ma/AQ3n7 OzI/D585uIVzJf1P521nTazFwp+psrFBI/LSyBCaPAy2ARD+VC0n8B26wzLxNrqfQtiW 0g8EQTQJ4Cr6qTCOsxMNMC4kUvY6NWdw3vt62qF5UOrjtIVGWRxrFdXeJitFjboRkWSO GMrA== X-Gm-Message-State: ALoCoQl4rP7kqJB2Doxud/OsttYOCFeXLjhZMrkXf2kNUHTr7cDuM2LfxId96WenERZNz7dqBczP X-Received: by 10.50.171.233 with SMTP id ax9mr2521063igc.6.1406153921673; Wed, 23 Jul 2014 15:18:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.200 with SMTP id 66ls652445qgv.85.gmail; Wed, 23 Jul 2014 15:18:41 -0700 (PDT) X-Received: by 10.220.1.198 with SMTP id 6mr6620222vcg.31.1406153921543; Wed, 23 Jul 2014 15:18:41 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id mo1si3679173vec.31.2014.07.23.15.18.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 15:18:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so3372746vcb.21 for ; Wed, 23 Jul 2014 15:18:41 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr6814665vcb.48.1406153921406; Wed, 23 Jul 2014 15:18:41 -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 tc5csp316622vcb; Wed, 23 Jul 2014 15:18:40 -0700 (PDT) X-Received: by 10.66.231.139 with SMTP id tg11mr5523376pac.87.1406153920055; Wed, 23 Jul 2014 15:18:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14si1942237pdj.315.2014.07.23.15.18.39 for ; Wed, 23 Jul 2014 15:18:40 -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 S933959AbaGWWSi (ORCPT + 17 others); Wed, 23 Jul 2014 18:18:38 -0400 Received: from mail-qg0-f48.google.com ([209.85.192.48]:54032 "EHLO mail-qg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933646AbaGWWSg (ORCPT ); Wed, 23 Jul 2014 18:18:36 -0400 Received: by mail-qg0-f48.google.com with SMTP id i50so2251627qgf.21 for ; Wed, 23 Jul 2014 15:18:36 -0700 (PDT) X-Received: by 10.140.91.164 with SMTP id z33mr6526210qgd.65.1406153916094; Wed, 23 Jul 2014 15:18:36 -0700 (PDT) Received: from xanadu.home (modemcable177.143-130-66.mc.videotron.ca. [66.130.143.177]) by mx.google.com with ESMTPSA id g3sm6031146qar.31.2014.07.23.15.18.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 15:18:35 -0700 (PDT) Date: Wed, 23 Jul 2014 18:18:34 -0400 (EDT) From: Nicolas Pitre To: Russell King - ARM Linux cc: Steven Rostedt , Ingo Molnar , Daniel Lezcano , Catalin Marinas , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/4] ARM: add IPI tracepoints In-Reply-To: <1405660735-13408-3-git-send-email-nicolas.pitre@linaro.org> Message-ID: References: <1405660735-13408-1-git-send-email-nicolas.pitre@linaro.org> <1405660735-13408-3-git-send-email-nicolas.pitre@linaro.org> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.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: 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.176 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: , @Russell: Can I have your ACK on this patch before I send the series upstream? Here's the revised version accounting for the changes the discussion in this thread brought about Author: Nicolas Pitre Date: Fri Jul 18 00:07:05 2014 -0400 ARM: add IPI tracepoints The strings used to list IPIs in /proc/interrupts are reused for tracing purposes. While at it, prevent a negative ipinr from escaping the range check in handle_IPI(). Signed-off-by: Nicolas Pitre Acked-by: Steven Rostedt --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 7c4fada440..9388a3d479 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -47,6 +47,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 @@ -430,38 +433,15 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } -static void (*smp_cross_call)(const struct cpumask *, unsigned int); +static void (*__smp_cross_call)(const struct cpumask *, unsigned int); void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int)) { - if (!smp_cross_call) - 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_wakeup_ipi_mask(const struct cpumask *mask) -{ - smp_cross_call(mask, IPI_WAKEUP); -} - -void arch_send_call_function_single_ipi(int cpu) -{ - smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); + if (!__smp_cross_call) + __smp_cross_call = fn; } -#ifdef CONFIG_IRQ_WORK -void arch_irq_work_raise(void) -{ - if (is_smp()) - smp_cross_call(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); -} -#endif - -static const char *ipi_types[NR_IPI] = { +static const char *ipi_types[NR_IPI] __tracepoint_string = { #define S(x,s) [x] = s S(IPI_WAKEUP, "CPU wakeup interrupts"), S(IPI_TIMER, "Timer broadcast interrupts"), @@ -473,6 +453,12 @@ static const char *ipi_types[NR_IPI] = { S(IPI_COMPLETION, "completion 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; @@ -499,6 +485,29 @@ 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_wakeup_ipi_mask(const struct cpumask *mask) +{ + smp_cross_call(mask, IPI_WAKEUP); +} + +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 (is_smp()) + smp_cross_call(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); +} +#endif + #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST void tick_broadcast(const struct cpumask *mask) { @@ -556,8 +565,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 < NR_IPI) + if ((unsigned)ipinr < NR_IPI) { + trace_ipi_entry(ipi_types[ipinr]); __inc_irq_stat(cpu, ipi_irqs[ipinr]); + } switch (ipinr) { case IPI_WAKEUP: @@ -612,6 +623,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs) cpu, ipinr); break; } + + if ((unsigned)ipinr < NR_IPI) + trace_ipi_exit(ipi_types[ipinr]); set_irq_regs(old_regs); }