Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111105942
D34527.id103749.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
D34527.id103749.diff
View Options
Index: lib/libpmc/libpmc.c
===================================================================
--- lib/libpmc/libpmc.c
+++ lib/libpmc/libpmc.c
@@ -763,13 +763,20 @@
static struct pmc_event_alias cortex_a76_aliases[] = {
EV_ALIAS(NULL, NULL)
};
+
static int
-arm64_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
- struct pmc_op_pmcallocate *pmc_config __unused)
+arm64_allocate_pmc(enum pmc_event pe, char *ctrspec,
+ struct pmc_op_pmcallocate *pmc_config)
{
- switch (pe) {
- default:
- break;
+ char *p;
+
+ while ((p = strsep(&ctrspec, ",")) != NULL) {
+ if (KWMATCH(p, "os"))
+ pmc_config->pm_caps |= PMC_CAP_SYSTEM;
+ else if (KWMATCH(p, "usr"))
+ pmc_config->pm_caps |= PMC_CAP_USER;
+ else
+ return (-1);
}
return (0);
Index: sys/dev/hwpmc/hwpmc_arm64.c
===================================================================
--- sys/dev/hwpmc/hwpmc_arm64.c
+++ sys/dev/hwpmc/hwpmc_arm64.c
@@ -187,6 +187,16 @@
if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST))
return (EINVAL);
}
+
+ switch (a->pm_caps & (PMC_CAP_SYSTEM | PMC_CAP_USER)) {
+ case PMC_CAP_SYSTEM:
+ config |= PMEVTYPER_U;
+ break;
+ case PMC_CAP_USER:
+ config |= PMEVTYPER_P;
+ break;
+ }
+
pm->pm_md.pm_arm64.pm_arm64_evsel = config;
PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 28, 12:13 PM (21 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16885248
Default Alt Text
D34527.id103749.diff (1 KB)
Attached To
Mode
D34527: arm64 hwpmc: Support restricting counters to user or kernel mode.
Attached
Detach File
Event Timeline
Log In to Comment