Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105774953
D2557.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
D2557.diff
View Options
Index: head/sys/dev/hwpmc/hwpmc_core.c
===================================================================
--- head/sys/dev/hwpmc/hwpmc_core.c
+++ head/sys/dev/hwpmc/hwpmc_core.c
@@ -203,6 +203,10 @@
static pmc_value_t
iaf_perfctr_value_to_reload_count(pmc_value_t v)
{
+
+ /* If the PMC has overflowed, return a reload count of zero. */
+ if ((v & (1ULL << (core_iaf_width - 1))) == 0)
+ return (0);
v &= (1ULL << core_iaf_width) - 1;
return (1ULL << core_iaf_width) - v;
}
@@ -1806,6 +1810,10 @@
static pmc_value_t
iap_perfctr_value_to_reload_count(pmc_value_t v)
{
+
+ /* If the PMC has overflowed, return a reload count of zero. */
+ if ((v & (1ULL << (core_iap_width - 1))) == 0)
+ return (0);
v &= (1ULL << core_iap_width) - 1;
return (1ULL << core_iap_width) - v;
}
Index: head/sys/dev/hwpmc/hwpmc_mod.c
===================================================================
--- head/sys/dev/hwpmc/hwpmc_mod.c
+++ head/sys/dev/hwpmc/hwpmc_mod.c
@@ -1435,7 +1435,7 @@
tmp += pm->pm_sc.pm_reloadcount;
mtx_pool_lock_spin(pmc_mtxpool, pm);
pp->pp_pmcs[ri].pp_pmcval -= tmp;
- if ((int64_t) pp->pp_pmcs[ri].pp_pmcval < 0)
+ if ((int64_t) pp->pp_pmcs[ri].pp_pmcval <= 0)
pp->pp_pmcs[ri].pp_pmcval +=
pm->pm_sc.pm_reloadcount;
mtx_pool_unlock_spin(pmc_mtxpool, pm);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 12:48 PM (17 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15541493
Default Alt Text
D2557.diff (1 KB)
Attached To
Mode
D2557: Fix two issues that caused sampling to effectively stop.
Attached
Detach File
Event Timeline
Log In to Comment