Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F116019032
D31221.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
D31221.diff
View Options
diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -577,6 +577,7 @@
pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
{
const struct pmu_event *pe;
+ struct pmu_event_desc ped;
int idx = -1;
event_name = pmu_alias_get(event_name);
@@ -584,8 +585,12 @@
return (ENOENT);
if (pe->event == NULL)
return (ENOENT);
+ if (pmu_parse_event(&ped, pe->event))
+ return (ENOENT);
assert(idx >= 0);
+ pm->pm_ev = idx;
+ pm->pm_md.pm_md_config = ped.ped_event;
pm->pm_md.pm_md_flags |= PM_MD_RAW_EVENT;
pm->pm_class = PMC_CLASS_ARMV8;
pm->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
diff --git a/sys/arm64/include/pmc_mdep.h b/sys/arm64/include/pmc_mdep.h
--- a/sys/arm64/include/pmc_mdep.h
+++ b/sys/arm64/include/pmc_mdep.h
@@ -38,10 +38,12 @@
#include <dev/hwpmc/hwpmc_arm64.h>
union pmc_md_op_pmcallocate {
- uint32_t pm_md_flags;
+ struct {
+ uint32_t pm_md_config;
+ uint32_t pm_md_flags;
#define PM_MD_RAW_EVENT 0x1
- uint32_t __pad32;
- uint64_t __pad[3];
+ };
+ uint64_t __pad[4];
};
/* Logging */
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
@@ -182,9 +182,9 @@
pe = a->pm_ev;
/* Adjust the config value if needed. */
- config = (uint32_t)pe;
+ config = a->pm_md.pm_md_config;
if ((a->pm_md.pm_md_flags & PM_MD_RAW_EVENT) == 0) {
- config -= PMC_EV_ARMV8_FIRST;
+ config = (uint32_t)pe - PMC_EV_ARMV8_FIRST;
if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST))
return (EINVAL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 4:50 PM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17908286
Default Alt Text
D31221.diff (1 KB)
Attached To
Mode
D31221: Fix various issues with commit 28dd6730a5d6, 8cc3815f02be
Attached
Detach File
Event Timeline
Log In to Comment