Bug 200616 - pmcstat runs out of buckets
Summary: pmcstat runs out of buckets
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: George V. Neville-Neil
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-06-03 16:11 UTC by Hans Petter Selasky
Modified: 2015-06-08 20:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Petter Selasky freebsd_committer 2015-06-03 16:11:07 UTC
Hi,

It has been observed that pmcstat can run out of buckets leading to an assert, when converting trace data into gprof compatible format. Applying the following patch, temporarily solves the problem:

diff --git a/usr.sbin/pmcstat/pmcpl_gprof.c b/usr.sbin/pmcstat/pmcpl_gprof.c
index 9ff78e8..4a8849f 100644
--- a/usr.sbin/pmcstat/pmcpl_gprof.c
+++ b/usr.sbin/pmcstat/pmcpl_gprof.c
@@ -445,8 +445,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
                image, pmcid);
            pgf->pgf_pmcid = pmcid;
            assert(image->pi_end > image->pi_start);
-               pgf->pgf_nbuckets = (image->pi_end - image->pi_start) /
-                   FUNCTION_ALIGNMENT; /* see <machine/profile.h> */
+               pgf->pgf_nbuckets = (image->pi_end - image->pi_start); // /
+       //                  FUNCTION_ALIGNMENT; /* see <machine/profile.h> */
            pgf->pgf_ndatabytes = sizeof(struct gmonhdr) +
                pgf->pgf_nbuckets * sizeof(HISTCOUNTER);
            pgf->pgf_nsamples = 0; 

--HPS