Page MenuHomeFreeBSD

Fix various issues with commit 28dd6730a5d6, 8cc3815f02be
ClosedPublic

Authored by mhorne on Jul 19 2021, 8:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 2:07 AM
Unknown Object (File)
Feb 1 2024, 7:49 AM
Unknown Object (File)
Jan 19 2024, 11:05 PM
Unknown Object (File)
Dec 22 2023, 11:00 PM
Unknown Object (File)
Dec 12 2023, 6:47 AM
Unknown Object (File)
Nov 29 2023, 4:24 PM
Unknown Object (File)
Nov 20 2023, 12:19 PM
Unknown Object (File)
Nov 20 2023, 12:18 PM
Subscribers

Details

Summary

Due to a mis-merge, the committed version never called
pmu_parse_event(), or set pm->pm_ev. However, this field shouldn't be
used to carry the actual pmc event code anyway, as it is expected to
contain the index into the pmu event array (otherwise, it breaks event
name lookup in pmclog_get_event()). Add a new MD field,
pm_md.pm_md_config, to pass the event code to arm64_allocate_pmc().

Additionally, the change made to pmc_md_op_pmcallocate was incorrect, as
this is a union, not a struct. Restore the proper padding.

Test Plan

Verified that the correct event codes are being written to the config registers by enabling the hwpmc ktr(4) tracepoints.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40535
Build 37424: arc lint + arc unit

Event Timeline

sys/arm64/include/pmc_mdep.h
45

Assuming there's no issue with using C11 anonymous structs... I found at least one other recent commit doing so.

sys/arm64/include/pmc_mdep.h
46

Is this used by userspace? It's a union, so this would change the size. (The old code seems to assume it's a struct)

sys/arm64/include/pmc_mdep.h
46

Yes, this is visible to userspace. It was my recent change 8cc3815f02be that mistakenly treated it as a struct, so this restores the previous size.

LGTM. The changes are similar to the PPC64 ones, in D31109.

This revision is now accepted and ready to land.Jul 20 2021, 2:08 PM
mhorne retitled this revision from Fix various issues with commit 28dd6730a5d6 to Fix various issues with commit 28dd6730a5d6, 8cc3815f02be.Jul 20 2021, 2:10 PM

Seeing the title change reminded me. It would be useful if you provided at least a tiny bit more context here, even if it is to just mention hwpmc so that git log --oneline is a bit more useful.