Page MenuHomeFreeBSD

Fix various issues with commit 28dd6730a5d6, 8cc3815f02be
ClosedPublic

Authored by mhorne on Jul 19 2021, 8:58 PM.
Tags
None
Referenced Files
F106066583: D31221.diff
Tue, Dec 24, 8:06 PM
Unknown Object (File)
Mon, Dec 9, 3:53 AM
Unknown Object (File)
Wed, Nov 27, 4:36 AM
Unknown Object (File)
Nov 24 2024, 10:54 PM
Unknown Object (File)
Nov 17 2024, 7:43 AM
Unknown Object (File)
Nov 13 2024, 11:43 PM
Unknown Object (File)
Nov 11 2024, 9:44 PM
Unknown Object (File)
Nov 4 2024, 11:33 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.