Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp935945rwr; Wed, 3 May 2023 08:06:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4spMn236unrZiiGRAlzYDraJIMOPXkjLRBSb/LpinD+qfYjbHcKj+gxijy20xRQJcbwZbV X-Received: by 2002:a17:902:dac5:b0:1a6:93cc:924b with SMTP id q5-20020a170902dac500b001a693cc924bmr8035577plx.3.1683126412549; Wed, 03 May 2023 08:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683126412; cv=none; d=google.com; s=arc-20160816; b=IRVPXMrpNHevkIZUMuVpRtO5rASbjUsPFeuacV1B4AscDhizz9/JNrQNvIyD4Xxo20 USWahpCde6rjLzdxdAPsX/NO+mXuK22gzFzlGxf60XGytSbuWcBXvLdiUAHXoQvREHso hrk14vdgtLTDvMSREfZk/lP+MqVsYdjHaEwdjSsHr3LBWlSSm1Z8FR4RDhekOC7lHWtt jtXURcoHCt23xXEkkC/CoC+2uiRGcFHL6QTEAJwH8cZ3RYvOcbgAArAkGfQXoaJVnDVF 0q2onN0mm7eQ/OXaQH+/WAcGNYBlwrgoz15gyhlXspFM0svGSBBhD9KGS7bhz2a/DV6V 6ueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JAgcGCa0iriRDIyulwuKYkDgWlBOM5XWRjlSwXqyJII=; b=fYmPCKXdktI6moCWw9FqWMMk6aX2xKPWPH3mUcF14lEmtcfZVcPxeRpD7cHuEAUWkq rczYhZLLEsV3hF8pd1Ivq7FWnQdhh+cFtVvf+ZjCSl+SusgEd+nuV+jMjl2vLr5OZk12 t3jIAzF5QZwROJGH+eOsL+twLxC460aHyuuSq75/zgVXdodFZZeVyu23jYZ20/0z0JxA 6fXxY09W+/r6wJo1RqCwKHOZjU84n4NWTxQm2gWaUyj2PEg1cU951zjOskFHfYAep5dM 190hwtkWetJ7MfYboa0784Q34PAJnCgVATbc512eyGz+IOkdETmC2pC74AIA5QYAX8Bu +RCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=G1Zex2TA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik18-20020a170902ab1200b0019ca7a76d68si31864323plb.67.2023.05.03.08.06.38; Wed, 03 May 2023 08:06:52 -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=@infradead.org header.s=casper.20170209 header.b=G1Zex2TA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjECO7k (ORCPT + 99 others); Wed, 3 May 2023 10:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjECO7j (ORCPT ); Wed, 3 May 2023 10:59:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22BE449F9; Wed, 3 May 2023 07:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=JAgcGCa0iriRDIyulwuKYkDgWlBOM5XWRjlSwXqyJII=; b=G1Zex2TAl4dZV3a31P0gQgnMta x8hsYyMh0VoT+gBaPejSZ/jDxzfuM62caV//+sXBaIRCRjwKI6t4QXzvsHZWj8YN9xSTOHhWdikk9 cvE4AdB9nfURRccj93tKNbu5lH2bEplLU1ZnOP6/6/ADFeKM+J8CvWfwNk3BCR5EH8ovb8wr6ZOia 0hSiMiE7akTrxstEGLRa5cE6F+mu0BNG0mH2H7erYfQAP3fUd/yn6QRyFE/WqWQzlcRLIpgQYNMyV 6Y8SjvWYKrb/bNpSRRC+xcn5Q+ZqmGxawMzCF1jeCtPkJy8bJz5eVY9PtQ6c5Ur9cPjmRBqQbmxq8 Nh8BCCUg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1puDwe-009eL7-RX; Wed, 03 May 2023 14:59:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D1AFC30339B; Wed, 3 May 2023 16:59:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B2CCE241DA2D7; Wed, 3 May 2023 16:59:00 +0200 (CEST) Date: Wed, 3 May 2023 16:59:00 +0200 From: Peter Zijlstra To: Leonardo =?iso-8859-1?Q?Br=E1s?= Cc: Steven Rostedt , Masami Hiramatsu , Thomas Gleixner , Yury Norov , "Paul E. McKenney" , Sebastian Andrzej Siewior , Nadav Amit , Zhen Lei , Chen Zhongjin , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Marcelo Tosatti , vschneid@redhat.com Subject: Re: [RFC PATCH 1/1] smp: Add tracepoints for functions called with smp_call_function*() Message-ID: <20230503145900.GC1689514@hirez.programming.kicks-ass.net> References: <20230406075718.68672-1-leobras@redhat.com> <20230406095519.GG386572@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 On Wed, Apr 19, 2023 at 12:45:08AM -0300, Leonardo Br?s wrote: > On Thu, 2023-04-06 at 11:55 +0200, Peter Zijlstra wrote: > > On Thu, Apr 06, 2023 at 04:57:18AM -0300, Leonardo Bras wrote: > > > When running RT workloads in isolated CPUs, many cases of deadline misses > > > are caused by remote CPU requests such as smp_call_function*(). > > > > > > For those cases, having the names of those functions running around the > > > deadline miss moment could help finding a target for the next improvements. > > > > > > Add tracepoints for acquiring the funtion name & argument before entry and > > > after exitting the called function. > > > > > > Signed-off-by: Leonardo Bras > > > > How are the patches queued there not sufficient? > > > > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=smp/core > > > > IIUC the last commits add tracepoints that are collected in the > requesting CPU, at the moment of scheduling the IPI, which are also useful in > some scenarios. > > On my scenario, it could help a little,?since it makes possible to filter what > all other cpus are scheduling on the requested cpu. OTOH it could be also be > misleading, as the requested cpu could be running something that was scheduled > way before. > > The change I propose does exactly what my scenario need: track exactly which > function was running at given time in the requested CPU. With this info, we can > check which (if any) remotely requested function was running on given time > window. I was thinking you could simply (graph)-trace __flush_smp_call_function_queue() with a max_graph_depth or so (Steve says that ought to work). But even that might be too specific, your use case sounds more like what we have the irq-off latency tracer for, and that thing will immediately tell you what functions were being ran. > (An unrelated thing I just thought: We could even use the commits you pointed > together with my proposed change in order to measure how long does it take for a > requested function to run / complete in the requested cpu) I don't think you could actually do that; the send tracepoints Valentin added don't log the csd address, this means you cannot distinguish two CSDs with the same function send from different CPUs. To do this you'd need to add the csd address to the the ipi_send tracepoints and your own (possibly replacing info -- because I don't think that's too useful). Valentin -- is any of this something you'd also find useful?