Page MenuHomeFreeBSD

D21920.diff
No OneTemporary

D21920.diff

Index: lib/libpmcstat/libpmcstat.h
===================================================================
--- lib/libpmcstat/libpmcstat.h
+++ lib/libpmcstat/libpmcstat.h
@@ -377,7 +377,8 @@
struct pmcstat_process *pmcstat_kernproc,
int pmcstat_mergepmc,
int *pmcstat_npmcs,
- int *ps_samples_period);
+ int *ps_samples_period,
+ int *map_in_count);
int pmcstat_open_log(const char *_p, int _mode);
int pmcstat_close_log(struct pmcstat_args *args);
Index: lib/libpmcstat/libpmcstat_image.c
===================================================================
--- lib/libpmcstat/libpmcstat_image.c
+++ lib/libpmcstat/libpmcstat_image.c
@@ -386,6 +386,21 @@
break;
}
}
+ } else if (eh.e_type == ET_DYN) {
+ for (i = 0; i < eh.e_phnum; i++) {
+ if (gelf_getphdr(e, i, &ph) != &ph) {
+ warnx(
+"WARNING: Retrieval of PHDR entry #%ju in \"%s\" failed: %s.",
+ (uintmax_t) i, buffer, elf_errmsg(-1));
+ goto done;
+ }
+ switch (ph.p_type) {
+ case PT_LOAD:
+ if ((ph.p_flags & PF_X) != 0)
+ image->pi_vaddr = ph.p_vaddr & (-ph.p_align);
+ break;
+ }
+ }
}
/*
Index: lib/libpmcstat/libpmcstat_logging.c
===================================================================
--- lib/libpmcstat/libpmcstat_logging.c
+++ lib/libpmcstat/libpmcstat_logging.c
@@ -192,7 +192,8 @@
struct pmcstat_process *pmcstat_kernproc,
int pmcstat_mergepmc,
int *pmcstat_npmcs,
- int *ps_samples_period)
+ int *ps_samples_period,
+ int *map_in_count)
{
uint32_t cpu, cpuflags;
pid_t pid;
@@ -221,6 +222,8 @@
break;
case PMCLOG_TYPE_MAP_IN:
+ if (map_in_count)
+ *map_in_count += 1;
/*
* Introduce an address range mapping for a
* userland process or the kernel (pid == -1).
Index: usr.sbin/pmcstat/pmcstat_log.c
===================================================================
--- usr.sbin/pmcstat/pmcstat_log.c
+++ usr.sbin/pmcstat/pmcstat_log.c
@@ -514,8 +514,9 @@
if (args.pa_flags & FLAG_DO_PRINT)
return (pmcstat_print_log());
else
- return (pmcstat_analyze_log(&args, plugins, &pmcstat_stats, pmcstat_kernproc,
- pmcstat_mergepmc, &pmcstat_npmcs, &ps_samples_period));
+ return (pmcstat_analyze_log(&args, plugins, &pmcstat_stats,
+ pmcstat_kernproc, pmcstat_mergepmc, &pmcstat_npmcs,
+ &ps_samples_period, NULL));
}
/*

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 9, 12:55 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23448676
Default Alt Text
D21920.diff (2 KB)

Event Timeline