From owner-svn-src-all@freebsd.org Thu Oct 8 09:46:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BDB59D161A; Thu, 8 Oct 2015 09:46:36 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5340EB6E; Thu, 8 Oct 2015 09:46:36 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t989kZer092699; Thu, 8 Oct 2015 09:46:35 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t989kZpO092698; Thu, 8 Oct 2015 09:46:35 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201510080946.t989kZpO092698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Thu, 8 Oct 2015 09:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289023 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 09:46:36 -0000 Author: fabient Date: Thu Oct 8 09:46:35 2015 New Revision: 289023 URL: https://svnweb.freebsd.org/changeset/base/289023 Log: Fix for r288176 changes related to debug symbols move. Reviewed by: emaste Sponsored by: Stormshield Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Thu Oct 8 08:55:34 2015 (r289022) +++ head/usr.sbin/pmcstat/pmcstat_log.c Thu Oct 8 09:46:35 2015 (r289023) @@ -966,21 +966,32 @@ pmcstat_image_addr2line(struct pmcstat_i char *funcname, size_t funcname_len) { static int addr2line_warn = 0; - unsigned l; char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; + unsigned l; int fd; if (image->pi_addr2line == NULL) { - snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", + /* Try default debug file location. */ + snprintf(imagepath, sizeof(imagepath), + "/usr/lib/debug/%s%s.debug", args.pa_fsroot, pmcstat_string_unintern(image->pi_fullpath)); fd = open(imagepath, O_RDONLY); if (fd < 0) { - snprintf(imagepath, sizeof(imagepath), "%s%s", + /* Old kernel symbol path. */ + snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", args.pa_fsroot, pmcstat_string_unintern(image->pi_fullpath)); - } else + fd = open(imagepath, O_RDONLY); + if (fd < 0) { + snprintf(imagepath, sizeof(imagepath), "%s%s", + args.pa_fsroot, + pmcstat_string_unintern( + image->pi_fullpath)); + } + } + if (fd >= 0) close(fd); /* * New addr2line support recursive inline function with -i