From owner-svn-src-stable-7@FreeBSD.ORG Mon Aug 9 14:33:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F801065679; Mon, 9 Aug 2010 14:33:25 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0618FC1B; Mon, 9 Aug 2010 14:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o79EXP3A017116; Mon, 9 Aug 2010 14:33:25 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o79EXPD5017112; Mon, 9 Aug 2010 14:33:25 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201008091433.o79EXPD5017112@svn.freebsd.org> From: Fabien Thomas Date: Mon, 9 Aug 2010 14:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211101 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 14:33:25 -0000 Author: fabient Date: Mon Aug 9 14:33:25 2010 New Revision: 211101 URL: http://svn.freebsd.org/changeset/base/211101 Log: MFC r210797: - Do not use the runtime mask when logfile is specified. - Revert the fix on rtld path that is not necessary. Modified: stable/7/usr.sbin/pmcstat/pmcstat.c stable/7/usr.sbin/pmcstat/pmcstat.h stable/7/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:32:45 2010 (r211100) +++ stable/7/usr.sbin/pmcstat/pmcstat.c Mon Aug 9 14:33:25 2010 (r211101) @@ -641,6 +641,7 @@ main(int argc, char **argv) else cpumask = pmcstat_get_cpumask(optarg); + args.pa_flags |= FLAGS_HAS_CPUMASK; args.pa_required |= FLAG_HAS_SYSTEM_PMCS; break; @@ -884,6 +885,13 @@ main(int argc, char **argv) args.pa_argc = (argc -= optind); args.pa_argv = (argv += optind); + /* If we read from logfile and no specified CPU mask use + * the maximum CPU count. + */ + if ((args.pa_flags & FLAG_READ_LOGFILE) && + (args.pa_flags & FLAGS_HAS_CPUMASK) == 0) + cpumask = 0xffffffff; + args.pa_cpumask = cpumask; /* For selecting CPUs using -R. */ if (argc) /* command line present */ Modified: stable/7/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat.h Mon Aug 9 14:32:45 2010 (r211100) +++ stable/7/usr.sbin/pmcstat/pmcstat.h Mon Aug 9 14:33:25 2010 (r211101) @@ -51,6 +51,7 @@ #define FLAG_DO_ANNOTATE 0x00008000 /* -m */ #define FLAG_DO_TOP 0x00010000 /* -T */ #define FLAG_DO_ANALYSIS 0x00020000 /* -g or -G or -m or -T */ +#define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ #define DEFAULT_SAMPLE_COUNT 65536 #define DEFAULT_WAIT_INTERVAL 5.0 Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:32:45 2010 (r211100) +++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Mon Aug 9 14:33:25 2010 (r211101) @@ -609,7 +609,7 @@ pmcstat_image_get_elf_params(struct pmcs GElf_Phdr ph; GElf_Shdr sh; enum pmcstat_image_type image_type; - char buffer[PATH_MAX], rtldpath[PATH_MAX]; + char buffer[PATH_MAX]; assert(image->pi_type == PMCSTAT_IMAGE_UNKNOWN); @@ -689,10 +689,9 @@ pmcstat_image_get_elf_params(struct pmcs buffer, elf_errmsg(-1)); goto done; } - snprintf(rtldpath, sizeof(rtldpath), "%s%s", - args.pa_fsroot, elfbase + ph.p_offset); image->pi_dynlinkerpath = - pmcstat_string_intern(rtldpath); + pmcstat_string_intern(elfbase + + ph.p_offset); break; case PT_LOAD: if (ph.p_offset == 0)