From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754264AbcIQSyY (ORCPT ); Sat, 17 Sep 2016 14:54:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49830 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753916AbcIQSyU (ORCPT ); Sat, 17 Sep 2016 14:54:20 -0400 Date: Sat, 17 Sep 2016 13:54:13 -0500 From: Josh Poimboeuf To: Vegard Nossum Cc: Linus Torvalds , Peter Zijlstra , Stephane Eranian , Vince Weaver , LKML , Alexander Shishkin , Ingo Molnar , Kees Cook Subject: Re: [PATCH] scripts: add script for translating stack dump function offsets Message-ID: <20160917185413.mms2zb3lkmrk6wy5@treble> References: <20160915072425.GN5008@twins.programming.kicks-ass.net> <20160915121014.ox5ytlplt7wz5cpk@treble> <20160916144807.6yrdznupo3bpe5b2@treble> <20160916191738.v3kq3c44zmdsvlgb@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 17 Sep 2016 18:54:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 17, 2016 at 11:11:44AM +0200, Vegard Nossum wrote: > On 16 September 2016 at 21:17, Josh Poimboeuf wrote: > > On Fri, Sep 16, 2016 at 11:12:10AM -0700, Linus Torvalds wrote: > >> Side note: I find addr2line almost completely useless in many cases > >> not because of address space randomization, but because of how complex > >> the inlining often is. I just had something where I decided to use > >> addr2line and it just pointed me to the __read_once_size_nocheck() > >> line in . That was not very useful. > >> > >> I ended up actually looking at the instructions *around* it, to find > >> where that one instruction had been inlined from. > >> > >> So I'm wondering if this kind of helper script could be extended to > >> have that "look around it" thing to help. > > > > I think that issue is solved by addr2line's '--inline' option, which the > > script uses: > > Another small gotcha is that stack trace addresses are _return > addresses_, not callsites. So you'll sometimes want to pass 'addr - 1' > instead of just addr, as the next address (the return address) may > belong to a completely unrelated deeply inlined function. Hm, good point. In that case, should it *always* subtract 1? (Except when the offset is already 0, of course.) -- Josh