From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755291AbbHCT2I (ORCPT ); Mon, 3 Aug 2015 15:28:08 -0400 Received: from mail.kernel.org ([198.145.29.136]:41457 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754039AbbHCT2F (ORCPT ); Mon, 3 Aug 2015 15:28:05 -0400 Date: Mon, 3 Aug 2015 16:27:59 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Adrian Hunter , Borislav Petkov , Frederic Weisbecker , Namhyung Kim , Stephane Eranian , Steven Rostedt Subject: Re: [PATCH 11/18] perf script: Switch from perf.data's kallsyms to perf's symbol resolver Message-ID: <20150803192759.GD5498@kernel.org> References: <1437703111-4930-1-git-send-email-acme@kernel.org> <1437703111-4930-12-git-send-email-acme@kernel.org> <20150803174113.GA20282@krava.redhat.com> <20150803190009.GC5498@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150803190009.GC5498@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Aug 03, 2015 at 04:00:09PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Aug 03, 2015 at 07:41:13PM +0200, Jiri Olsa escreveu: > > Missing separate debuginfos, use: dnf debuginfo-install glibc-2.21-7.fc22.x86_64 > > [Thread debugging using libthread_db enabled] > > Using host libthread_db library "/lib64/libthread_db.so.1". > > Detaching after fork from child process 11230. > > > > Program received signal SIGSEGV, Segmentation fault. > > 0x00000000004eeace in pevent_set_function_resolver (pevent=0x0, func=0x4a3197 , priv=0x18e1f48) at event-parse.c:464 > > 464 free(pevent->func_resolver); > > Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.4.3-1.fc22.x86_64 bzip2-libs-1.0.6-14.fc22.x86_64 elfutils-libelf-0.163-1.fc22.x86_64 elfutils-libs-0.163-1.fc22.x86_64 libunwind-1.1-10.fc22.x86_64 nss-softokn-freebl-3.19.2-1.0.fc22.x86_64 numactl-libs-2.0.10-2.fc22.x86_64 perl-libs-5.20.2-326.fc22.x86_64 python-libs-2.7.10-4.fc22.x86_64 slang-2.3.0-2.fc22.x86_64 xz-libs-5.2.0-2.fc22.x86_64 zlib-1.2.8-7.fc22.x86_64 > > (gdb) > > > I think 'session->tevent.pevent' gets initialized only for tracepoint, right? > > Reproduced, checking. Yeah, I think we only need to set libtraceevent's function resolver if there are tracepoints, i.e. if libtraceevent is being used. Following patch should be enough, right? - Arnaldo diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index bd31380122f9..7912feb9a024 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1861,7 +1861,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) else symbol_conf.use_callchain = false; - if (pevent_set_function_resolver(session->tevent.pevent, + if (session->tevent.pevent && + pevent_set_function_resolver(session->tevent.pevent, machine__resolve_kernel_addr, &session->machines.host) < 0) { pr_err("%s: failed to set libtraceevent function resolver\n", __func__);