Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Support event aliases in pmcstat #1514

wants to merge 3 commits into from

Conversation

arichardson
Copy link
Member

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 and pmcstat -p cycles on my morello board.

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).
Copy link
Collaborator

@bsdjhb bsdjhb left a 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);
Copy link
Collaborator

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 */

Copy link
Member

@jrtc27 jrtc27 left a 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"},
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants