Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178277341
D62377.1796405290.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62377.1796405290.diff
View Options
diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c
--- a/sys/dev/hwpmc/hwpmc_logging.c
+++ b/sys/dev/hwpmc/hwpmc_logging.c
@@ -757,7 +757,7 @@
int
pmclog_deconfigure_log(struct pmc_owner *po)
{
- int error;
+ int error, i;
struct pmclog_buffer *lb;
struct pmc_binding pb;
@@ -784,7 +784,7 @@
pmc_plb_rele(lb);
}
pmc_save_cpu_binding(&pb);
- for (int i = 0; i < mp_ncpus; i++) {
+ CPU_FOREACH(i) {
pmc_select_cpu(i);
/* return the 'current' buffer to the global pool */
if ((lb = po->po_curbuf[curcpu]) != NULL) {
@@ -863,12 +863,13 @@
pmclog_schedule_all(struct pmc_owner *po)
{
struct pmc_binding pb;
+ int i;
/*
* Schedule the current buffer if any and not empty.
*/
pmc_save_cpu_binding(&pb);
- for (int i = 0; i < mp_ncpus; i++) {
+ CPU_FOREACH(i) {
pmc_select_cpu(i);
pmclog_schedule_one_cond(po);
}
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -2730,8 +2730,8 @@
pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK | M_ZERO);
pmc->pm_runcount = counter_u64_alloc(M_WAITOK);
- pmc->pm_pcpu_state = malloc(sizeof(struct pmc_pcpu_state) * mp_ncpus,
- M_PMC, M_WAITOK | M_ZERO);
+ pmc->pm_pcpu_state = malloc(pmc_cpu_max() *
+ sizeof(struct pmc_pcpu_state), M_PMC, M_WAITOK | M_ZERO);
PMCDBG1(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc);
return (pmc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 4, 5:28 PM (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42210836
Default Alt Text
D62377.1796405290.diff (1 KB)
Attached To
Mode
D62377: hwpmc: Size and walk per-CPU state by CPU ID
Attached
Detach File
Event Timeline