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)
Wed, Oct 30, 2:54 AM
Unknown Object (File)
Mon, Oct 14, 8:38 PM
Unknown Object (File)
Mon, Oct 14, 8:37 PM
Unknown Object (File)
Mon, Oct 14, 8:07 PM
Unknown Object (File)
Sep 23 2024, 5:22 PM
Unknown Object (File)
Sep 21 2024, 1:37 AM
Unknown Object (File)
Sep 15 2024, 8:34 PM
Unknown Object (File)
Sep 8 2024, 2:53 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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