-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support event aliases in pmcstat #1514
base: dev
Are you sure you want to change the base?
Conversation
Since we don't have a .json pmu event description file for Morello, the pmc_pmu_enabled() check always fails and we don't use pmc_pmu_pmcallocate() which would check for aliases.
This change allows me to use events such as "cycles,usr" by saving the old suffix and restricting event aliases to not include suffixes (none of them do right now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these look sensible and are worth upstreaming. Don't appear to be Morello specific though so might want to tweak the log messages for upstream.
@@ -1114,6 +1114,12 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, | |||
break; | |||
} | |||
|
|||
/* Try pmu_alias_get as another generic fallback/ */ | |||
if (spec_copy == NULL) { | |||
const char* alias_name = _pmu_alias_get(ctrspec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/const char* /const char */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style compliance for these commits is a bit all over the place
@@ -175,6 +176,7 @@ static struct pmu_alias pmu_armv8_alias_table[] = { | |||
{"BRANCH-INSTRUCTION-RETIRED", "BR_RETIRED"}, | |||
{"BRANCH_MISSES_RETIRED", "BR_MIS_PRED_RETIRED"}, | |||
{"BRANCH-MISSES-RETIRED", "BR_MIS_PRED_RETIRED"}, | |||
{"cycles", "CPU_CYCLES"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The x86 tables in here don't have this either
Since we don't have a .json pmu event description file for Morello, the
pmc_pmu_enabled() check always fails and we don't use pmc_pmu_pmcallocate()
which would check for aliases.
If this looks reasonable, I'll send the changes upstream as well - just wanted something that unbreaks
pmc stat
andpmcstat -p cycles
on my morello board.