Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153395755
D35400.id106702.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D35400.id106702.diff
View Options
Index: share/man/man4/hwpmc.4
===================================================================
--- share/man/man4/hwpmc.4
+++ share/man/man4/hwpmc.4
@@ -416,6 +416,9 @@
.Nm Ns 's
logging function.
The default buffer size is 4KB.
+.It Va kern.hwpmc.mincount Pq integer, read-write
+The minimum sampling rate for sampling mode PMCs.
+The default count is 1000 events.
.It Va kern.hwpmc.mtxpoolsize Pq integer, read-only
The size of the spin mutex pool used by the PMC driver.
The default is 32.
Index: sys/dev/hwpmc/hwpmc_mod.c
===================================================================
--- sys/dev/hwpmc/hwpmc_mod.c
+++ sys/dev/hwpmc/hwpmc_mod.c
@@ -366,6 +366,14 @@
"maximum number of available thread entries before freeing some");
+/*
+ * kern.hwpmc.mincount -- minimum sample count
+ */
+static u_int pmc_mincount = 1000;
+SYSCTL_INT(_kern_hwpmc, OID_AUTO, mincount, CTLFLAG_RWTUN,
+ &pmc_mincount, 0,
+ "minimum count for sampling counters");
+
/*
* security.bsd.unprivileged_syspmcs -- allow non-root processes to
* allocate system-wide PMCs.
@@ -3951,13 +3959,16 @@
/* XXX set lower bound on sampling for process counters */
if (PMC_IS_SAMPLING_MODE(mode)) {
/*
- * Don't permit requested sample rate to be less than 1000
+ * Don't permit requested sample rate to be
+ * less than pmc_mincount.
*/
- if (pa.pm_count < 1000)
- log(LOG_WARNING,
- "pmcallocate: passed sample rate %ju - setting to 1000\n",
- (uintmax_t)pa.pm_count);
- pmc->pm_sc.pm_reloadcount = MAX(1000, pa.pm_count);
+ if (pa.pm_count < MAX(1, pmc_mincount))
+ log(LOG_WARNING, "pmcallocate: passed sample "
+ "rate %ju - setting to %u\n",
+ (uintmax_t)pa.pm_count,
+ MAX(1, pmc_mincount));
+ pmc->pm_sc.pm_reloadcount = MAX(MAX(1, pmc_mincount),
+ pa.pm_count);
} else
pmc->pm_sc.pm_initial = pa.pm_count;
@@ -4475,13 +4486,16 @@
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
/*
- * Don't permit requested sample rate to be less than 1000
+ * Don't permit requested sample rate to be
+ * less than pmc_mincount.
*/
- if (sc.pm_count < 1000)
- log(LOG_WARNING,
- "pmcsetcount: passed sample rate %ju - setting to 1000\n",
- (uintmax_t)sc.pm_count);
- pm->pm_sc.pm_reloadcount = MAX(1000, sc.pm_count);
+ if (sc.pm_count < MAX(1, pmc_mincount))
+ log(LOG_WARNING, "pmcsetcount: passed sample "
+ "rate %ju - setting to %u\n",
+ (uintmax_t)sc.pm_count,
+ MAX(1, pmc_mincount));
+ pm->pm_sc.pm_reloadcount = MAX(MAX(1, pmc_mincount),
+ sc.pm_count);
} else
pm->pm_sc.pm_initial = sc.pm_count;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 10:10 PM (6 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31936201
Default Alt Text
D35400.id106702.diff (2 KB)
Attached To
Mode
D35400: hwpmc: Permit the minimum sampling count to be set as a sysctl.
Attached
Detach File
Event Timeline
Log In to Comment