summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat
diff options
context:
space:
mode:
authorfabient <fabient@FreeBSD.org>2010-08-03 13:46:25 +0000
committerfabient <fabient@FreeBSD.org>2010-08-03 13:46:25 +0000
commit3327e8714209c4d4c9bb58dd4c03090e6e6eee25 (patch)
tree3d32dc6bdea086231cf73030612de96d8afa5b37 /usr.sbin/pmcstat
parent734aeecfaf9811848828ac86fa014c15a94dcc5d (diff)
downloadFreeBSD-src-3327e8714209c4d4c9bb58dd4c03090e6e6eee25.zip
FreeBSD-src-3327e8714209c4d4c9bb58dd4c03090e6e6eee25.tar.gz
- Do not use the runtime mask when logfile is specified.
- Revert the fix on rtld path that is not necessary. MFC after: 1 week
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r--usr.sbin/pmcstat/pmcstat.c8
-rw-r--r--usr.sbin/pmcstat/pmcstat.h1
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c7
3 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index b661ef9..ab3846c 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -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 */
diff --git a/usr.sbin/pmcstat/pmcstat.h b/usr.sbin/pmcstat/pmcstat.h
index 1bb7862..c9c24a9 100644
--- a/usr.sbin/pmcstat/pmcstat.h
+++ b/usr.sbin/pmcstat/pmcstat.h
@@ -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
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c
index 3303059..d9e6059 100644
--- a/usr.sbin/pmcstat/pmcstat_log.c
+++ b/usr.sbin/pmcstat/pmcstat_log.c
@@ -609,7 +609,7 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image)
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 pmcstat_image *image)
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)
OpenPOWER on IntegriCloud