Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102731807
D27973.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
D27973.diff
View Options
diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c
--- a/sys/dev/hwpmc/hwpmc_arm64.c
+++ b/sys/dev/hwpmc/hwpmc_arm64.c
@@ -215,12 +215,12 @@
/* Clear Overflow Flag */
WRITE_SPECIALREG(pmovsclr_el0, reg);
if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
- pm->pm_overflowcnt++;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt++;
/* Reread counter in case we raced. */
tmp = arm64_pmcn_read(ri);
}
- tmp += 0x100000000llu * pm->pm_overflowcnt;
+ tmp += 0x100000000llu * pm->pm_pcpu_state[cpu].pps_overflowcnt;
intr_restore(s);
PMCDBG2(MDP, REA, 2, "arm64-read id=%d -> %jd", ri, tmp);
@@ -249,7 +249,7 @@
PMCDBG3(MDP, WRI, 1, "arm64-write cpu=%d ri=%d v=%jx", cpu, ri, v);
- pm->pm_overflowcnt = v >> 32;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt = v >> 32;
arm64_pmcn_write(ri, v);
return 0;
@@ -373,7 +373,7 @@
retval = 1; /* Found an interrupting PMC. */
if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
- pm->pm_overflowcnt += 1;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt += 1;
continue;
}
diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c
--- a/sys/dev/hwpmc/hwpmc_armv7.c
+++ b/sys/dev/hwpmc/hwpmc_armv7.c
@@ -192,12 +192,12 @@
/* Clear Overflow Flag */
cp15_pmovsr_set(reg);
if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
- pm->pm_overflowcnt += 1;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt++;
/* Reread counter in case we raced. */
tmp = armv7_pmcn_read(ri, pm->pm_md.pm_armv7.pm_armv7_evsel);
}
- tmp += 0x100000000llu * pm->pm_overflowcnt;
+ tmp += 0x100000000llu * pm->pm_pcpu_state[cpu].pps_overflowcnt;
intr_restore(s);
PMCDBG2(MDP, REA, 2, "armv7-read id=%d -> %jd", ri, tmp);
@@ -226,7 +226,7 @@
PMCDBG3(MDP, WRI, 1, "armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v);
- pm->pm_overflowcnt = v >> 32;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt = v >> 32;
if (pm->pm_md.pm_armv7.pm_armv7_evsel == PMC_EV_CPU_CYCLES)
cp15_pmccntr_set(v);
else
@@ -363,7 +363,7 @@
retval = 1; /* Found an interrupting PMC. */
if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
- pm->pm_overflowcnt += 1;
+ pm->pm_pcpu_state[cpu].pps_overflowcnt += 1;
continue;
}
if (pm->pm_state != PMC_STATE_RUNNING)
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h
--- a/sys/sys/pmc.h
+++ b/sys/sys/pmc.h
@@ -729,6 +729,7 @@
*
*/
struct pmc_pcpu_state {
+ uint32_t pps_overflowcnt; /* count overflow interrupts */
uint8_t pps_stalled;
uint8_t pps_cpustate;
} __aligned(CACHE_LINE_SIZE);
@@ -773,7 +774,6 @@
struct pmc_owner *pm_owner; /* owner thread state */
counter_u64_t pm_runcount; /* #cpus currently on */
enum pmc_state pm_state; /* current PMC state */
- uint32_t pm_overflowcnt; /* count overflow interrupts */
/*
* The PMC ID field encodes the row-index for the PMC, its
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 11:54 AM (21 h, 41 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14676162
Default Alt Text
D27973.diff (2 KB)
Attached To
Mode
D27973: Move the PMC overflow count to make it per-CPU
Attached
Detach File
Event Timeline
Log In to Comment