Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp372184rwe; Thu, 1 Sep 2022 00:24:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w3iWsNO1OHjvs6GSfbaEFAnLilSFifMXBi+A1WM3SMYCXjvxadwbd9bgXmfPBPyOaT+zO X-Received: by 2002:a17:902:a986:b0:172:fecb:103 with SMTP id bh6-20020a170902a98600b00172fecb0103mr29490925plb.28.1662017086051; Thu, 01 Sep 2022 00:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662017086; cv=none; d=google.com; s=arc-20160816; b=nM7tX575j8WMuBqZ+ZprWZlMZGvzRPGWX8RpDnEPGeCSjLOYVWclkgelVXidGk67Ee 5CSkrSASHOlPgaOePF3kQwEpZe/iKnQJ6NUwqc5ibfgBPIwRy9IB2RZbG04cV84jVxHG OptFORSN9XnOF9SiuZabb+FdtVuseeaYThUmmd1dMgAL/AcEza1mqAs7pkVZgXeJCK5K VuMkBT//aCI81A3TvlPPDMfoRE2Tpon8PpBWtj1SUivWN7pSFXNkKYpgQyorxusdb8Y6 mHJMg8g0UlAty/m/5u+hKWVPGAkTOTuox4LsPwKX+n3kZW2mfCLEpIoKgX5ne1eu11E1 mcoA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0alPrNIyXUGsDd/lDjKfjoAzSlLEpkpL3yJZZ94RPpk=; b=nwFoHC20q9ZqxnfI2P9g0PI9Tj/QAmtQNDhp2FBo8BtH4JMcAD+llkN41YVg9DUSvN VblkmOWWt/gP1TscNQRVpx01GjidxGBDAYXliAESCVWSQo03GX1WGy1qJgJ0TKSKKhjb 4OoR5Am4HYWhbBq8AID45RBfEAxezruaTBYqfX2a3GoKtR+YNDpxYP9GI09BH1LJroOB 7LDqmNNmt92VZIpTFz+MiAIQHpO18yDdEgXtIdVKcarhikSdIvn5c4QKzuVbR8TzyEBq qNOZ36Gwqu4bndjvLCxtJQMEGhBC0BlPkZW4MCif0WWL5JrZ12kU5gPOPcqHNPn953uB +rFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=HKZ8zbQD; 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 s12-20020a17090302cc00b0016d8a0cd540si16656113plk.510.2022.09.01.00.24.34; Thu, 01 Sep 2022 00:24:46 -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=desiato.20200630 header.b=HKZ8zbQD; 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 S233222AbiIAHL1 (ORCPT + 99 others); Thu, 1 Sep 2022 03:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232531AbiIAHLZ (ORCPT ); Thu, 1 Sep 2022 03:11:25 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE31E1173; Thu, 1 Sep 2022 00:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0alPrNIyXUGsDd/lDjKfjoAzSlLEpkpL3yJZZ94RPpk=; b=HKZ8zbQDTcxT7/jy9grUcHmJ4v MyVzgFvSrbPQLFiwijNHUSSiUlaaBHzCHBs9+70BEVDM9MToqbrQNr8UvWxofIcrrX8GwM6eOonSK 6szU8OuuHG+vfDK7qTco/TEVeTjPEsrJy2NwBMJGxQIiApv2ohzIAIMYAKmyu71oXfi4BkKZh1EEf yDito6PTpR0FPBaeSnYB/G3xro4IABhjAP4qO2n2U1vtuvb2UuRIjbvpWBj437K+oapKyEpvo3Au1 q4o6vAz6W9ihYu06aO9bYWS3Cfufchc9RQ+BxIjoMxuDoh8gMbcVTNj7wicKWVFNNupBfEUvp7p4r G0W8NxwA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTeMA-008LX1-Ry; Thu, 01 Sep 2022 07:11:19 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D18AF300223; Thu, 1 Sep 2022 09:11:17 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B51EF20981381; Thu, 1 Sep 2022 09:11:17 +0200 (CEST) Date: Thu, 1 Sep 2022 09:11:17 +0200 From: Peter Zijlstra To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, void@manifault.com, juri.lelli@redhat.com, ldufour@linux.ibm.com, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, changbin.du@intel.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, arnd@arndb.de, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-mm@kvack.org, iommu@lists.linux.dev, kasan-dev@googlegroups.com, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 27/30] Code tagging based latency tracking Message-ID: References: <20220830214919.53220-1-surenb@google.com> <20220830214919.53220-28-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830214919.53220-28-surenb@google.com> 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 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 Tue, Aug 30, 2022 at 02:49:16PM -0700, Suren Baghdasaryan wrote: > From: Kent Overstreet > > This adds the ability to easily instrument code for measuring latency. > To use, add the following to calls to your code, at the start and end of > the event you wish to measure: > > code_tag_time_stats_start(start_time); > code_tag_time_stats_finish(start_time); > > Stastistics will then show up in debugfs under > /sys/kernel/debug/time_stats, listed by file and line number. > > Stastics measured include weighted averages of frequency, duration, max > duration, as well as quantiles. > > This patch also instruments all calls to init_wait and finish_wait, > which includes all calls to wait_event. Example debugfs output: How can't you do this with a simple eBPF script on top of trace_sched_stat_* and friends?