Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752270AbbKXHY6 (ORCPT ); Tue, 24 Nov 2015 02:24:58 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:59232 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbbKXHY5 convert rfc822-to-8bit (ORCPT ); Tue, 24 Nov 2015 02:24:57 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 165.244.98.203 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Tue, 24 Nov 2015 16:24:50 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo CC: =?utf-8?B?5bmz5p2+6ZuF5bezIC8gSElSQU1BVFXvvIxNQVNBTUk=?= , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Frederic Weisbecker Subject: Re: [RFC/PATCH] perf tools: Introduce perf_thread for backtrace Message-ID: <20151124072450.GC2636@sejong> References: <1447999383-15456-1-git-send-email-namhyung@kernel.org> <50399556C9727B4D88A595C8584AAB375262792C@GSjpTKYDCembx32.service.hitachi.net> <20151120121044.GJ29361@kernel.org> MIME-Version: 1.0 In-Reply-To: <20151120121044.GJ29361@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2015/11/24 16:24:51, Serialize by Router on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2015/11/24 16:24:51 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1992 Lines: 47 Hi Arnaldo and Masami, On Fri, Nov 20, 2015 at 09:10:44AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Nov 20, 2015 at 09:05:23AM +0000, 平松雅巳 / HIRAMATU,MASAMI escreveu: > > >From: Namhyung Kim [mailto:namhyung@kernel.org] > > > > > >Backtrace is a crucial info for debugging. And upcoming refcnt > > >tracking facility also wants to use it. > > > > > >So instead of relying on glibc's backtrace_symbols[_fd] which misses > > >some (static) functions , use our own symbol searching mechanism. To > > >do that, add perf_thread global variable to keep its maps and symbols. > > > > Hmm, I doubt that this can work for debugging situation, because > > sometimes backtrace facilities has to debug itself by itself. > > That is a valid point, possibly we can have both and when we think that > the code we rely on for resolving symbols has issues, activate the > other, more expensive, binutils/elfutils spawned command line utilities > to do compare the results? Yeah, that's a possible solution. We can start by using our own, and if there's a certain amount of failure in symbol resolving, then fallback to glibc's backtrace_symbols + addr2line. > > > For the some (static) functions, I'd rather like to use glibc's > > backtrace_symbols and addr2line or even with raw address for > > reliability... I also printed the raw addresses in case of doubts, so you could verify its correctness. :) And IMHO, if something is severely broken, we might not rely on glibc too. Having said that, I agree with your concern and it needs the fallback method for possible malfunction. But I guess it'd work quite well for most cases so it's worth trying to convert using it. I'll work on the fallback method then.. Thanks, Namhyung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/