From patchwork Thu Sep 18 01:50:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 37579 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BABC32054D for ; Thu, 18 Sep 2014 01:50:56 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id d1sf166667wiv.11 for ; Wed, 17 Sep 2014 18:50:56 -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:message-id :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=Z8Rzw0pLGEiG5bcSVBYG15RRW/s1CU7JXa3hnWQRVZY=; b=Se8leOPhvd6zfRBQnbIbWCQOij6Luv7JOfQ4KJSIIVDLCdU81s90NrsTGsQMNi/w8s bHEes/0jJkx6R8palIVINNN9nqPjTBtGS679//t9gfUJhXsrBuKDfLRXA4/f3tHyV38m ia/w9h51hxMZRVLZRO8P8Pblg2qFbuPa0GduyTe8/iOb95I1QrVIY7qC9VP8gdzLafl2 hSgjH2+MoRcvF0iBeAQcWpuJUyoWuz+qxC84LTg3dUIJlkuHCtZTc3maMxW+1vmTVgBR lfRERd2e/o6vabELVjMsW+hgFTPjrJZINqfx9aLnOt4o5JPbxhWFZ1hJpR9GDmQocyY+ eZCA== X-Gm-Message-State: ALoCoQmUV05LjqVzPWTcdnavG3Ujul2wIh7iN8ft4uTFQsKO1aKZW/BYhI/pdblFwd2QFd6Vgxus X-Received: by 10.180.73.79 with SMTP id j15mr8326529wiv.4.1411005055981; Wed, 17 Sep 2014 18:50:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.134 with SMTP id b6ls152882laa.77.gmail; Wed, 17 Sep 2014 18:50:55 -0700 (PDT) X-Received: by 10.152.30.100 with SMTP id r4mr25910lah.87.1411005055697; Wed, 17 Sep 2014 18:50:55 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx.google.com with ESMTPS id v7si9052961laj.78.2014.09.17.18.50.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 18:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id z11so216037lbi.26 for ; Wed, 17 Sep 2014 18:50:55 -0700 (PDT) X-Received: by 10.152.43.99 with SMTP id v3mr1316002lal.13.1411005055551; Wed, 17 Sep 2014 18:50:55 -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.112.130.169 with SMTP id of9csp681030lbb; Wed, 17 Sep 2014 18:50:54 -0700 (PDT) X-Received: by 10.68.175.99 with SMTP id bz3mr1679959pbc.112.1411005053924; Wed, 17 Sep 2014 18:50:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bx15si37362044pdb.103.2014.09.17.18.50.53 for ; Wed, 17 Sep 2014 18:50:53 -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 S1757324AbaIRBuv (ORCPT + 27 others); Wed, 17 Sep 2014 21:50:51 -0400 Received: from mail-qg0-f45.google.com ([209.85.192.45]:47742 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755705AbaIRBut (ORCPT ); Wed, 17 Sep 2014 21:50:49 -0400 Received: by mail-qg0-f45.google.com with SMTP id j107so253146qga.18 for ; Wed, 17 Sep 2014 18:50:49 -0700 (PDT) X-Received: by 10.224.12.134 with SMTP id x6mr2523727qax.49.1411005049010; Wed, 17 Sep 2014 18:50:49 -0700 (PDT) Received: from xanadu.home ([2607:fa48:6d48:fb10:21c:c0ff:fe2a:325b]) by mx.google.com with ESMTPSA id g6sm15662412qai.6.2014.09.17.18.50.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 18:50:48 -0700 (PDT) Date: Wed, 17 Sep 2014 21:50:46 -0400 (EDT) From: Nicolas Pitre To: Ingo Molnar , Steven Rostedt cc: Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] X86: add IPI tracepoints Message-ID: 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.217.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: , 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 Acked-by: Daniel Lezcano --- This is a resent. This patch was part of a larger series that got merged during the last merge window. -- 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/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)