Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6498361rwl; Wed, 22 Mar 2023 11:22:53 -0700 (PDT) X-Google-Smtp-Source: AK7set87WCUXOnvfiK7cq3yqcV+QZJ+o4B7ujntacZrw2cWx8Rrwnj6iYl6x3Cu/np4wOUujXG69 X-Received: by 2002:aa7:8f3c:0:b0:593:ed9c:9f07 with SMTP id y28-20020aa78f3c000000b00593ed9c9f07mr3689389pfr.27.1679509373523; Wed, 22 Mar 2023 11:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679509373; cv=none; d=google.com; s=arc-20160816; b=uHhCqyb5DNjMrJHT6R2+7Je/x7V2zycryrPytFFllOfVUGgnBqSChteU3iguHia2WU ke8pLHmHuUCtNQKED+rOOzFvLkGC8Ig1YYZXEXp/jm4CHmewFxLTd0+gCs8V2hHgIKbR IlMDRduIUFS//oE28aaUPCEFc4grA4maPL0CVAqLhQzdKIF+KAmNXxo7Ul6oA6ygdD+l Hkr1HHMdEDi6UcEInWAeCoETA9YIvPFsJ5qftUj7BQjDqnNTrKcaIN+X144W21xeDT5d Yj0yOwAV73K+Ss9ThHaHJOonNrJuCIdlZzx6K4bw3ZY0opa5CBk2bfK13nHkU70evuUB B6xA== 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:subject:cc:to:from:date; bh=OB5Bc+Gd1+jdlSccD/7ZMD+6O9TzTINYxFgOyVit5Wc=; b=kx9t0wDchFj5PnzBvVSJpaFrxGtnnhnAsl6dg1lpa7PhzJQgb1kxowSM06XVaKLK9v Oo8thxLDkmCjuVnIG7IMkZUoXC96qyVsCokvK97YzzTFABlPmPcLStxEVIghuw6W0OCR A1MTAUTvNITpELeg7oSoEu0gP7s4Ffg3vtKp7n5/Aa6KtUhIZoVxqBG1M5qE2hAM/181 Fz5r0fqTgUy64P7I/cB+174sKUUmqVKmceTw1ZUjNYiZ/rQ5rA6LGBCHrpY0rrX6Smco Mz0FziiGNTgI1W4IddHWxN/HRMDpoF13RvmyjZE8daP4sVLOb8lnxGYwH2ldNQOeiP6N 0GNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 v191-20020a6389c8000000b0050c567e931asi14843742pgd.780.2023.03.22.11.22.41; Wed, 22 Mar 2023 11:22: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; 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 S231206AbjCVSRU (ORCPT + 99 others); Wed, 22 Mar 2023 14:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbjCVSRD (ORCPT ); Wed, 22 Mar 2023 14:17:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABA467030; Wed, 22 Mar 2023 11:17:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67D2562264; Wed, 22 Mar 2023 18:17:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC589C433D2; Wed, 22 Mar 2023 18:16:58 +0000 (UTC) Date: Wed, 22 Mar 2023 14:16:57 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Peter Zijlstra , Josh Poimboeuf , Ross Zwisler , Joel Fernandes , "Paul E. McKenney" , Miroslav Benes Subject: Re: [PATCH] tracing: Trace instrumentation begin and end Message-ID: <20230322141657.7d00a9bd@gandalf.local.home> In-Reply-To: <87v8is94n6.ffs@tglx> References: <20230321215121.71b339c5@gandalf.local.home> <87y1np824t.ffs@tglx> <20230322084834.37ed755e@gandalf.local.home> <87v8is94n6.ffs@tglx> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 On Wed, 22 Mar 2023 16:39:41 +0100 Thomas Gleixner wrote: > But for figuring out how long a syscall, interrupt or exception takes > there are exactly TWO tracepoints required, not 10 or 8. And it's bloody > obvious where to place them, right? Not always, and it's pretty much always architecture dependent. I was looking for an architecture agnostic approach, as I imagine all archs will be eventually using this. > > >> instrumentation_begin()/end() is solely meant for objtool validation and > >> nothing else. > >> > >> There are clearly less horrible ways to retrieve the #PF duration, no? > > > > It's not just for #PF, that was just one example. I use to use function > > graph tracing max_depth_count=1 to verify NO_HZ_FULL to make sure there's > > no entry into the kernel. That doesn't work anymore. Even compat syscalls > > are not traced. > > That still works. noinstr did neither break syscall tracing nor any of > the interrupt/exception tracepoints which can be used to validate the > NOHZ full mechanics. Your fancy favourite script might not work anymore, > but claiming that it can't be traced is just nonsense. I don't remember fully, but there was something that was missing. It was back in 2021, so I do not remember fully. That's when I first wrote this patch. I only just redisovered it and wanted to share ;-) The only thing I did differently since then was to add the page fault logic, because that was something I am currently interested it. Things could have changed since then. But if adding trace events for the missing syscalls and around exceptions for timing purposes is OK, then I'm happy to go that approach. > > > I lost a kernel feature with the noinstr push and this is the closest that > > comes to bringing it back. > > This is the closest _you_ came up with without thinking about it for a > split second. > > > And the more we add noinstr, the more the kernel becomes a black box > > again. > > It does not. noinstr is a technical requirement to keep instrumentation > out of code pathes which are not able to handle instrumentation. You > know that very well, so please stop this theatrical handwaving and come > back if you have sensible technical arguments. I never said nor implied that it's not important. I'm just concerned that we currently have no way to see when it's happening. But I'll drop this patch and look to add specific trace events in specific points to be able to get the timings that are useful. Thanks, -- Steve