From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932481AbcIQJLx (ORCPT ); Sat, 17 Sep 2016 05:11:53 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:35750 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754949AbcIQJLq (ORCPT ); Sat, 17 Sep 2016 05:11:46 -0400 MIME-Version: 1.0 In-Reply-To: <20160916191738.v3kq3c44zmdsvlgb@treble> References: <20160915072425.GN5008@twins.programming.kicks-ass.net> <20160915121014.ox5ytlplt7wz5cpk@treble> <20160916144807.6yrdznupo3bpe5b2@treble> <20160916191738.v3kq3c44zmdsvlgb@treble> From: Vegard Nossum Date: Sat, 17 Sep 2016 11:11:44 +0200 Message-ID: Subject: Re: [PATCH] scripts: add script for translating stack dump function offsets To: Josh Poimboeuf Cc: Linus Torvalds , Peter Zijlstra , Stephane Eranian , Vince Weaver , LKML , Alexander Shishkin , Ingo Molnar , Kees Cook Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Vegard