Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752937AbdF3VHv (ORCPT ); Fri, 30 Jun 2017 17:07:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:53694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752562AbdF3VHu (ORCPT ); Fri, 30 Jun 2017 17:07:50 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED02622BC9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 30 Jun 2017 17:07:40 -0400 From: Steven Rostedt To: Joel Fernandes Cc: LKML Subject: Re: [RFC] tracing: Add support for critical section event tracing Message-ID: <20170630170740.7a0eeaf5@gandalf.local.home> In-Reply-To: References: <20170412053851.26286-1-joelaf@google.com> <20170630085148.4eb252de@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1069 Lines: 33 On Fri, 30 Jun 2017 14:03:14 -0700 Joel Fernandes wrote: > Hi Steven, > > Thanks a lot for the comments, I agree with all of them and had a > comment about one of them: > > On Fri, Jun 30, 2017 at 5:51 AM, Steven Rostedt wrote: > [..] > > Are you not worried about recursion here? There's no protection. > > Wouldn't it be better to have: > > > > if (!this_cpu_read(tracing_events_cpu)) > > return; > > > > trace_critical_end(ip, parent_ip); > > > > this_cpu_write(tracing_events_cpu, 0); > > > > ? > > > > I tried to go over some scenarios and I think it shouldn't be a > problem because we start the critical event only when either > interrupts are turned off while preemption is turned on, or preempt is > turned off while interrupts are turned on, and the fact that we call > the tracer while still in the critical section. Let me know if you had > a scenario in mind that can cause problems with this. Then may I ask what is tracing_events_cpu actually protecting? -- Steve