Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1157036rwb; Fri, 7 Oct 2022 08:49:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/Fzdh03tzJa5pE10t4J/TQcFdUKWSirIN77BYTpUUXjbZYKHNqYfv+KCDOtUGc1UjCxvI X-Received: by 2002:a05:6402:3552:b0:451:2037:639e with SMTP id f18-20020a056402355200b004512037639emr5226333edd.136.1665157793199; Fri, 07 Oct 2022 08:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665157793; cv=none; d=google.com; s=arc-20160816; b=ffv8hlJcTaMddToUWMR53nbPphH3c4koGMlLOc0SoQJtiOJ+Yn5RelrZObtM+EK9En XbRGD5HVmGUfn4Xwj1QqW0QcluVVC8HkemRkPH07GXPKh9BJw4nG1S2XcU1EDxrZJuFg XTyyjRcT62IaVyotGOjLptjF+eMqwXOHDINfX2MpG6sxEN4BmfrtZC5xZJrnX+FXuWlv BzbmiXy68HUgQ6cpWSEmfE4mo0TggYrT+iB1XHuj7QWSsuL2uWlm+/R45gPSYWFNptpv 0GotOJb9HqTk8IcFf12LyReN89V2Oo9OEAWMPtpbY1hjmtEL/wv84ANObSDHi24QGDrA FBMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jAXnJ0u7W03NIJPSLVmnFtjZEFHwdySA+neP8cndke0=; b=f4+odpAKuzvgVp7kkj/IteBfyYFFio+L6kBY5D4vD0rRYpfZq8o1mP5U3LOiQHmNA9 umvAS0ciCOml7JqPYRLYmbsRXqz800fub9Ya70q9y12Y2+Sk7damGpPBW7dpPZkxJFv+ XpURBUfX+5z5A3LFZPM870dchOLnrOqnGOmPa7rcU60vj7rs4bxJ4hrpiwc77imLQht8 A5Ph7hMyGFJSWbvlvM1D14wiu2Ve3nPiAAe0ywh/vjweC12XxbAi22bIgCiRJeqs6esw 1mTU9SXodt/TzrsK9vKwklwS+rbwgXXSeFeVqXJRXK60LK0kl9D9cdGFHT0gq8hLJtZc 2jEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JlVQowDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a05640251cf00b00459074cf263si2417700edd.316.2022.10.07.08.49.26; Fri, 07 Oct 2022 08:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JlVQowDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbiJGPrC (ORCPT + 99 others); Fri, 7 Oct 2022 11:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbiJGPqa (ORCPT ); Fri, 7 Oct 2022 11:46:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A1810C4C9 for ; Fri, 7 Oct 2022 08:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665157582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jAXnJ0u7W03NIJPSLVmnFtjZEFHwdySA+neP8cndke0=; b=JlVQowDeZTIxccH1LF+ZFeYdgM0/bs7QFeq09MUQIMeYXmFJ53kkhebuQoA6Icgv6l8ody 18RdzD+zCVA5RFwwboJu7nU7R0Fhs5Nq1I/NMUMkQg71KGkaoJzION81Q/rUykr1p5SaAn A5ITh0oL3lRzC6+lkvb+gl2ERY4oxSg= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-398-sCPJHtO2NuGmU1oDrC3H0A-1; Fri, 07 Oct 2022 11:46:03 -0400 X-MC-Unique: sCPJHtO2NuGmU1oDrC3H0A-1 Received: by mail-wr1-f71.google.com with SMTP id k30-20020adfb35e000000b0022e04708c18so1579342wrd.22 for ; Fri, 07 Oct 2022 08:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jAXnJ0u7W03NIJPSLVmnFtjZEFHwdySA+neP8cndke0=; b=w5zhefKswrDe0r6AXXi/hiqJ5WSbjm9SUuCLH3JZNxon7IKlYuNACSC/Qr1/eS8D/x yh+IrfVHov9pqn/2wvhqPKpXhPzCidWhW6AGBbMuySPFAd2WuEoIGGnci5bdrWRIx3XK jlLOcETv7u9xNP6P2ixp5IN6FDBB8dqtxlSHxj/rzdZdLXsdYYPsN8T5OBDJghsTkkMR tQnsImTBF3hUQNcXMBHq8OWa7ExC1qR3dxKeVy4uaX+9k5thEb7HA929K4KjaKmJP1Yb Obs6dMSgVx/E8i78YgIt/xAr8YYGXgsHHtr9/fwDowo/70xpSfGxSGdaT/SxEBzg3SR6 JtGA== X-Gm-Message-State: ACrzQf3kJnN7SPGG//+aJE8tktXqY6PlwHX9KlXn+wDudQAV8MlzhgQy Ddr/lZmTYBkM3bqg//cp9IXVsQ5L1aRkk2s8hxr0v2KBtOtj3maJm1HZcv+F07yFtNNcaEq2zZO E0QSdGV1Ub6pguYK3LXkzn4n/ X-Received: by 2002:a05:600c:1d11:b0:3b4:7644:b788 with SMTP id l17-20020a05600c1d1100b003b47644b788mr4004386wms.114.1665157556419; Fri, 07 Oct 2022 08:45:56 -0700 (PDT) X-Received: by 2002:a05:600c:1d11:b0:3b4:7644:b788 with SMTP id l17-20020a05600c1d1100b003b47644b788mr4004355wms.114.1665157556194; Fri, 07 Oct 2022 08:45:56 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id i18-20020adfb652000000b0022e38c93195sm2339428wre.34.2022.10.07.08.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 08:45:55 -0700 (PDT) From: Valentin Schneider To: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org Cc: "Paul E. McKenney" , Steven Rostedt , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Frederic Weisbecker , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Marc Zyngier , Mark Rutland , Russell King , Nicholas Piggin , Guo Ren , "David S. Miller" Subject: [RFC PATCH 2/5] sched, smp: Trace send_call_function_single_ipi() Date: Fri, 7 Oct 2022 16:45:30 +0100 Message-Id: <20221007154533.1878285-2-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221007154145.1877054-1-vschneid@redhat.com> References: <20221007154145.1877054-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org send_call_function_single_ipi() is the thing that sends IPIs at the bottom of smp_call_function*() via either generic_exec_single() or smp_call_function_many_cond(). Give it an IPI-related tracepoint. Note that this ends up tracing any IPI sent via __smp_call_single_queue(), which covers __ttwu_queue_wakelist() and irq_work_queue_on() "for free". Signed-off-by: Valentin Schneider --- arch/arm/kernel/smp.c | 3 --- arch/arm64/kernel/smp.c | 1 - kernel/sched/core.c | 7 +++++-- kernel/smp.c | 4 ++++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 978db2d96b44..3b280d55c1c4 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -48,9 +48,6 @@ #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 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index ffc5d76cf695..937d2623e06b 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -51,7 +51,6 @@ #include #include -#define CREATE_TRACE_POINTS #include DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 60fdc0faf1c9..14e5e137172f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -81,6 +81,7 @@ #include #include #undef CREATE_TRACE_POINTS +#include #include "sched.h" #include "stats.h" @@ -3753,10 +3754,12 @@ void send_call_function_single_ipi(int cpu) { struct rq *rq = cpu_rq(cpu); - if (!set_nr_if_polling(rq->idle)) + if (!set_nr_if_polling(rq->idle)) { + trace_ipi_send_cpu(_RET_IP_, cpu); arch_send_call_function_single_ipi(cpu); - else + } else { trace_sched_wake_idle_without_ipi(cpu); + } } /* diff --git a/kernel/smp.c b/kernel/smp.c index e8cdc025a046..7a7a22d69972 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,6 +26,10 @@ #include #include +#define CREATE_TRACE_POINTS +#include +#undef CREATE_TRACE_POINTS + #include "smpboot.h" #include "sched/smp.h" -- 2.31.1