From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbdI3JId (ORCPT ); Sat, 30 Sep 2017 05:08:33 -0400 Received: from smtprelay0036.hostedemail.com ([216.40.44.36]:60765 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750933AbdI3JIc (ORCPT ); Sat, 30 Sep 2017 05:08:32 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:599:800:960:966:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2525:2553:2560:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4385:5007:6261:7875:8660:9025:9388:10004:10049:10400:10848:10967:11026:11232:11658:11914:12043:12438:12740:12760:12895:13069:13148:13230:13255:13311:13357:13439:14094:14181:14659:14721:14849:21080:21451:21627:30012:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cake16_49ea8d9d0dc48 X-Filterd-Recvd-Size: 2465 Date: Sat, 30 Sep 2017 05:08:17 -0400 From: Steven Rostedt To: Joel Fernandes Cc: Peter Zijlstra , LKML , kernel-team@android.com Subject: Re: [PATCH v6 2/2] tracing: Add support for preempt and irq enable/disable events Message-ID: <20170930050817.2a0147ba@vmware.local.home> In-Reply-To: References: <20170922015024.16123-1-joelaf@google.com> <20170922015024.16123-3-joelaf@google.com> <20170922090229.rdicci6emtyffqdn@hirez.programming.kicks-ass.net> <20170925083432.jvaewlsrb46wjmjj@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.15.0-dirty (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 On Mon, 25 Sep 2017 17:23:00 -0700 Joel Fernandes wrote: > The trace_hardirqs_off API can be called even when IRQs are already > off. This is unlike the trace_hardirqs_on which checks if IRQs are off > (atleast from some callsites), here are the definitions just for > reference [1]. I guess we could modify local_irq_disable and > local_irq_save to check what the HW flags was before calling > raw_local_irq_save and only then call trace_hardirqs_off if they were > indeed on and now being turned off, but that adds complexity to it - > also we have to then modify all the callsites from assembly code to > conditionally call trace_hardirqs_on/off :(. > > [1] http://elixir.free-electrons.com/linux/latest/source/include/linux/irqflags.h#L89 Yeah, I think the issue for the recursion is basically this: #define local_irq_restore(flags) \ do { \ if (raw_irqs_disabled_flags(flags)) { \ raw_local_irq_restore(flags); \ trace_hardirqs_off(); \ } else { \ trace_hardirqs_on(); \ raw_local_irq_restore(flags); \ } \ } while (0) Peter, Is there any place where we would call local_irq_restore() when interrupts are enabled? -- Steve