Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150041011
D16958.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D16958.diff
View Options
Index: head/lib/libpmc/libpmc_pmu_util.c
===================================================================
--- head/lib/libpmc/libpmc_pmu_util.c
+++ head/lib/libpmc/libpmc_pmu_util.c
@@ -237,6 +237,7 @@
return (ENOMEM);
r = event;
bzero(ped, sizeof(*ped));
+ ped->ped_period = DEFAULT_SAMPLE_COUNT;
ped->ped_umask = -1;
while ((kvp = strsep(&event, ",")) != NULL) {
key = strsep(&kvp, "=");
Index: head/sys/dev/hwpmc/hwpmc_mod.c
===================================================================
--- head/sys/dev/hwpmc/hwpmc_mod.c
+++ head/sys/dev/hwpmc/hwpmc_mod.c
@@ -61,6 +61,7 @@
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
+#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/vnode.h>
@@ -3942,9 +3943,16 @@
pmc->pm_flags = pa.pm_flags;
/* XXX set lower bound on sampling for process counters */
- if (PMC_IS_SAMPLING_MODE(mode))
- pmc->pm_sc.pm_reloadcount = pa.pm_count;
- else
+ if (PMC_IS_SAMPLING_MODE(mode)) {
+ /*
+ * Don't permit requested sample rate to be less than 1000
+ */
+ 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);
+ } else
pmc->pm_sc.pm_initial = pa.pm_count;
/* switch thread to CPU 'cpu' */
@@ -4460,9 +4468,16 @@
break;
}
- if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
- pm->pm_sc.pm_reloadcount = sc.pm_count;
- else
+ if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
+ /*
+ * Don't permit requested sample rate to be less than 1000
+ */
+ 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);
+ } else
pm->pm_sc.pm_initial = sc.pm_count;
}
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 10:51 PM (12 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30559501
Default Alt Text
D16958.diff (1 KB)
Attached To
Mode
D16958: set default rate if event description lacks one / filter sample rate for API misue
Attached
Detach File
Event Timeline
Log In to Comment