Page MenuHomeFreeBSD

Use fixed enum values for PMC_CLASSES().
ClosedPublic

Authored by jhb on May 19 2015, 4:02 PM.

Details

Summary

Use fixed enum values for PMC_CLASSES().

This removes one of the frequent causes of ABI breakage when new CPU
types are added to hwpmc(4).

Test Plan
  • Haven't tested this yet, but will test that pmcstat and pmccontrol still work on an Intel system.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb updated this revision to Diff 5482.May 19 2015, 4:02 PM
jhb retitled this revision from to Use fixed enum values for PMC_CLASSES()..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: emaste, davide.
davide accepted this revision.May 19 2015, 5:21 PM
davide edited edge metadata.

Sounds sensible.

sys/dev/hwpmc/hwpmc_mod.c
4639 ↗(On Diff #5482)

should we panic here instead, or it is too drastic?

This revision is now accepted and ready to land.May 19 2015, 5:21 PM
emaste accepted this revision.May 19 2015, 5:31 PM
emaste edited edge metadata.

seems reasonable

sys/dev/hwpmc/hwpmc_mod.c
4639 ↗(On Diff #5482)

too drastic I think

gnn accepted this revision.May 19 2015, 6:07 PM
gnn added a reviewer: gnn.
jhb updated this revision to Diff 5495.May 19 2015, 6:54 PM
jhb edited edge metadata.
  • Fix the class names output in dmesg.
This revision now requires review to proceed.May 19 2015, 6:54 PM
jhb accepted this revision.May 19 2015, 6:56 PM
jhb added a reviewer: jhb.

Tested and works fine on Intel at least modulo the comsetic fix for dmesg output I added.

This revision is now accepted and ready to land.May 19 2015, 6:56 PM
This revision was automatically updated to reflect the committed changes.