Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757556AbbLBIQL (ORCPT ); Wed, 2 Dec 2015 03:16:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36228 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755436AbbLBIQJ (ORCPT ); Wed, 2 Dec 2015 03:16:09 -0500 Date: Wed, 2 Dec 2015 09:16:05 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Frederic Weisbecker , Masami Hiramatsu Subject: Re: [PATCH v2] perf tools: Introduce perf_thread for backtrace Message-ID: <20151202081605.GB26308@krava.brq.redhat.com> References: <1449034941-15671-1-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449034941-15671-1-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 49 On Wed, Dec 02, 2015 at 02:42:21PM +0900, Namhyung Kim wrote: > 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. > > The backtrace output from TUI is changed like below. (I made a key > action to generate a segfault): > > Before: > perf: Segmentation fault > -------- backtrace -------- > perf[0x544a8b] > /usr/lib/libc.so.6(+0x33680)[0x7fc46420b680] > perf[0x54041b] > perf(perf_evlist__tui_browse_hists+0x91)[0x5432e1] > perf(cmd_report+0x1d20)[0x43cb10] > perf[0x487073] > perf(main+0x62f)[0x42cb1f] > /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fc4641f8610] > perf(_start+0x29)[0x42cc39] > > After: > perf: Segmentation fault > -------- backtrace -------- > perf_evsel__hists_browse(+0x43b) in perf [0x54066b] > perf_evlist__tui_browse_hists(+0x91) in perf [0x543531] > cmd_report(+0x1d20) in perf [0x43cb50] > run_builtin(+0x53) in perf [0x4870b3] > main(+0x634) in perf [0x42cb54] > __libc_start_main(+0xf0) in libc-2.22.so [0x7fea3577c610] > _start(+0x29) in perf [0x42cc79] > > Cc: Frederic Weisbecker > Cc: Masami Hiramatsu > Signed-off-by: Namhyung Kim > --- > v2) fallback to glibc's backtrace_symbols_fd() if failed create_perf_thread still returns void jirka -- 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/