Page MenuHomeFreeBSD

hwpmc: Move 4 bits of mode to extend class size to 8.
ClosedPublic

Authored by ray on Apr 30 2021, 2:57 PM.
Tags
Referenced Files
Unknown Object (File)
Mon, Mar 11, 4:50 AM
Unknown Object (File)
Sun, Mar 10, 9:01 PM
Unknown Object (File)
Feb 19 2024, 10:41 PM
Unknown Object (File)
Jan 9 2024, 3:05 AM
Unknown Object (File)
Dec 23 2023, 7:03 PM
Unknown Object (File)
Dec 22 2023, 11:49 PM
Unknown Object (File)
Dec 7 2023, 12:43 AM
Unknown Object (File)
Nov 25 2023, 12:23 PM
Subscribers

Details

Summary

Since r289025 we have at least 5 bits class size. (Before it was even 16 bits)
But macro handling conversion between pmcid and set of CPU, MODE, CLASS, ROWINDEX still use 4 bits class size and 8 bits mode size. It's break some libpmc API methods, like pmc_capabilities.
Looking on that, we have only 4 modes and MODE field is a number proposing patch moves 4 bits of mode to extend CLASS field.

Diff Detail

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

Event Timeline

ray requested review of this revision.Apr 30 2021, 2:57 PM
ray added a project: pmc.

This looks fine to me, thanks for fixing this.

It seems that pmc_id_t should be an opaque type for consumers of libpmc? I.e. the only userspace consumer of these bit macros should be libpmc itself.

If that is the case, then this change should be okay without a PMC_VERSION bump. There are no uses of PMC_ID_TO_MODE or PMC_ID_MAKE_ID in libpmc. However, I did not check if this was true for older releases.

This revision is now accepted and ready to land.May 5 2021, 2:29 PM
sys/sys/pmc.h
407

Comment needs updating?

This looks fine to me, thanks for fixing this.

It seems that pmc_id_t should be an opaque type for consumers of libpmc? I.e. the only userspace consumer of these bit macros should be libpmc itself.

If that is the case, then this change should be okay without a PMC_VERSION bump. There are no uses of PMC_ID_TO_MODE or PMC_ID_MAKE_ID in libpmc. However, I did not check if this was true for older releases.

I will check.
Thanks for review!

sys/sys/pmc.h
407

Sure. I will update it.
Thank you, Ed!

This revision now requires review to proceed.May 5 2021, 2:51 PM
ray marked an inline comment as done.May 5 2021, 2:53 PM
This revision is now accepted and ready to land.May 5 2021, 3:23 PM