From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751484AbdJFHHS (ORCPT ); Fri, 6 Oct 2017 03:07:18 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:53657 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdJFHHR (ORCPT ); Fri, 6 Oct 2017 03:07:17 -0400 Date: Fri, 6 Oct 2017 09:07:11 +0200 From: Peter Zijlstra To: Joel Fernandes Cc: LKML , kernel-team@android.com, Steven Rostedt , Ingo Molnar Subject: Re: [PATCH v7 2/2] tracing: Add support for preempt and irq enable/disable events Message-ID: <20171006070711.czekvhnwty6bouxi@hirez.programming.kicks-ass.net> References: <20170929212245.24168-1-joelaf@google.com> <20170929212245.24168-2-joelaf@google.com> <20171004160151.noficzcd4ef5ydml@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 05, 2017 at 04:28:10PM -0700, Joel Fernandes wrote: > > lockdep implements the trace_hardirq_*() in terms of *_caller(). Would > > that make sense here? > > In lockdep code, when trace_hardirqs_off is called, > trace_hardirqs_off_caller would pass CALLER_ADDR0 as > trace_hardirqs_off. > > Because of this, the first argument passed to time_hardirqs_off would > always be an offset within trace_hardirqs_off: > time_hardirqs_off(CALLER_ADDR0, ip); > > Is that intended? Seems to me that in the lockdep implementation of > trace_hardirqs_* in terms of *_caller(), we would completely miss the > second-last return address (CALLER_ADDR1) of trace_hardirqs_off(). > Also for the above reasons, I don't think it doesn't make sense to use > this reuse logic for the tracer. Atleast I feel it might change the > current behavior of the preempt/irqsoff tracer which I don't intend to > change with my current patch set. Hurm.. so I've no clue. I never looked at any of this. I think Ingo wrote that before I came joined the fun. He might (although unlikely, because its been _many_ years) still have some memories. But given that lockdep enabled kernels never got those arguments right, how useful are they? I mean, nobody seems to have noticed much.