Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178049590
D61369.1795848986.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
949 B
Referenced Files
None
Subscribers
None
D61369.1795848986.diff
View Options
diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c
--- a/sys/dev/hwpmc/hwpmc_soft.c
+++ b/sys/dev/hwpmc/hwpmc_soft.c
@@ -86,6 +86,7 @@
struct soft_cpu {
struct pmc_hw soft_hw[SOFT_NPMCS];
pmc_value_t soft_values[SOFT_NPMCS];
+ u_int soft_running[SOFT_NPMCS]; /* in ps_running */
};
@@ -329,7 +330,9 @@
ps = pmc_soft_ev_acquire(pm->pm_event);
if (ps == NULL)
return (EINVAL);
- atomic_add_int(&ps->ps_running, 1);
+ /* Count each row once. */
+ if (atomic_cmpset_int(&soft_pcpu[cpu]->soft_running[ri], 0, 1))
+ atomic_add_int(&ps->ps_running, 1);
pmc_soft_ev_release(ps);
return (0);
@@ -345,6 +348,9 @@
KASSERT(ri >= 0 && ri < SOFT_NPMCS,
("[soft,%d] illegal row-index %d", __LINE__, ri));
+ /* Accept duplicate stops. */
+ if (!atomic_cmpset_int(&soft_pcpu[cpu]->soft_running[ri], 1, 0))
+ return (0);
ps = pmc_soft_ev_acquire(pm->pm_event);
/* event unregistered ? */
if (ps != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 28, 6:56 AM (19 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41651933
Default Alt Text
D61369.1795848986.diff (949 B)
Attached To
Mode
D61369: hwpmc_soft: count each row once
Attached
Detach File
Event Timeline