Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp817283ybh; Tue, 10 Mar 2020 08:47:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vueryBL2y4fIFBeT1irGebzUm7AokcnLXh2Sq6Edj774cqNGzJwOa+VRdVC3IGdzO24tAGT X-Received: by 2002:aca:5210:: with SMTP id g16mr1679014oib.174.1583855270510; Tue, 10 Mar 2020 08:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583855270; cv=none; d=google.com; s=arc-20160816; b=aF0VcJiFYqzUw/Tn255PFvbf68GZt2u9CTc1OCUVMgGM0j5kii7sHLYfCFxX0azxLT vSDihRFnh7cRy9wWxaSJqTcl68O0YfjTL3NHGwdkMc3ZEYd/seF0aW+roPdt05N3BZtn n4d3yExxGntGLNOZ8XJaBCtPIEZc2XC7CVvyx6soDQwTxqOpbkR/jXSTIZdd8KhLk3DF dn4uPykLtWB9ZU3YFgAYdNGlf5Q9dMzbeiJzFnxKwsmSTYNGg8+om9xcK7PE7v3jbiJn oVy/0kMT6j7bj2wqe3JO36VIzNvBcErBbgs6D+u9KUoJpK3CDi+1/x7K26RuTTKqe+V7 XSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=/znUv2EOikj3HwJBTFgMFLIsxVQaVCLjKmdnZOi6Q9M=; b=owmuruMZJtwJ/2urM4UaIH3UTcSnCrpQdQNVbO9TP+EJ+wHG865Dbv4/42yeDU2kdm TtUOIMRrFIsybSn/Gf/YHP+HSabU4V2eP2KU7m+MeO+0CktUkX9ZVgR7IBYqOPYVg2Sp bM11jC3K/pUUxS7yPrt9pHlVIz5A0LkV7ZerECzf7X2symdN7DJ9q34GJYYkMVWa9gOr sZ8HeIpkUfx2nwoQdY+9JJ7DUluwlVasnkBqm/v9pQ4l/zg+O+PKg1Gh5xHrQUXiMBO7 MKboktb13Sy6J7ssXWJKytU7Bgx2qZ2cGEViAS4xbbs/BIMOi/KZwdml0SYFPQzciFNb EXRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si1750960oia.257.2020.03.10.08.47.38; Tue, 10 Mar 2020 08:47:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbgCJPrA (ORCPT + 99 others); Tue, 10 Mar 2020 11:47:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:57572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbgCJPrA (ORCPT ); Tue, 10 Mar 2020 11:47:00 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2874C20866; Tue, 10 Mar 2020 15:46:59 +0000 (UTC) Date: Tue, 10 Mar 2020 11:46:57 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: Thomas Gleixner , Masami Hiramatsu , linux-kernel , Peter Zijlstra , Alexei Starovoitov , paulmck , "Joel Fernandes, Google" , Frederic Weisbecker , Jason Wessel Subject: Re: Instrumentation and RCU Message-ID: <20200310114657.099122fd@gandalf.local.home> In-Reply-To: <450878559.23455.1583854311078.JavaMail.zimbra@efficios.com> References: <87mu8p797b.fsf@nanos.tec.linutronix.de> <20200309141546.5b574908@gandalf.local.home> <87fteh73sp.fsf@nanos.tec.linutronix.de> <20200310170951.87c29e9c1cfbddd93ccd92b3@kernel.org> <87pndk5tb4.fsf@nanos.tec.linutronix.de> <450878559.23455.1583854311078.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Mar 2020 11:31:51 -0400 (EDT) Mathieu Desnoyers wrote: > I think there are two distinct problems we are trying to solve here, > and it would be good to spell them out to see which pieces of technical > solution apply to which. > > Problem #1) Tracer invoked from partially initialized kernel context > > - Moving the early/late entry/exit points into sections invisible from > instrumentation seems to make tons of sense for this. > > Problem #2) Tracer recursion > > - I'm much less convinced that hiding entry points from instrumentation > works for this. As an example, with the isntr_begin/end() approach you > propose above, as soon as you have a tracer recursing into itself because > something below do_stuff() has been instrumented, having hidden the entry > point did not help at all. > > So I would be tempted to use the "hide entry/exit points" with explicit > instr begin/end annotation to solve Problem #1, but I'm still thinking there > is value in the per recursion context "in_tracing" flag to prevent tracer > recursion. The only recursion issue that I've seen discussed is breakpoints. And that's outside of the tracer infrastructure. Basically, if someone added a breakpoint for a kprobe on something that gets called in the int3 code before kprobes is called we have (let's say rcu_nmi_enter()): rcu_nmi_enter(); do_int3() { rcu_nmi_enter(); do_int3(); [..] Where would a "in_tracer" flag help here? Perhaps a "in_breakpoint" could? -- Steve