Skip to content

hwpmc: Query hwpmc for caps#2058

Closed
mashtizadeh wants to merge 1 commit intofreebsd:mainfrom
mashtizadeh:hwpmc-getcaps
Closed

hwpmc: Query hwpmc for caps#2058
mashtizadeh wants to merge 1 commit intofreebsd:mainfrom
mashtizadeh:hwpmc-getcaps

Conversation

@mashtizadeh
Copy link
Contributor

This change allows for fine-grained capabilities per counter index. This is particularly useful for AMD where subclasses are not exposed to the general PMC code, but other architectures also have assymetric behaviors when it comes to specific counter indicies.

Sponsored by: Netflix

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Thank you for taking the time to contribute to FreeBSD!

There is an issue that needs to be resolved:

  • Missing Signed-off-by lines (960ac84)

Note

Please review CONTRIBUTING.md, then update and push your branch again.

Some of files have special handling:

Important

@concussious wants to review changes to share/man/

@mashtizadeh mashtizadeh marked this pull request as draft March 2, 2026 03:13
@mashtizadeh
Copy link
Contributor Author

@bsdimp

@mashtizadeh mashtizadeh marked this pull request as ready for review March 10, 2026 17:25
@mashtizadeh
Copy link
Contributor Author

mashtizadeh commented Mar 10, 2026

Yea this is ready unless you have any comments.

Copy link
Contributor

@mhorne mhorne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sensible, and probably what was intended, based on the API of pmc_capbilities().

The new PMC_OP_GETCAPS op needs to be added to the hwpmc(4) man page.

@mashtizadeh
Copy link
Contributor Author

I'll update the docs for hwpmc in this patch. I'm still holding a few code patches that need to land to unblock a few other external collaborators. Once I get those out this week, I'll make my final pass on my hwpmc amd/ibs docs and push those too.

@mhorne
Copy link
Contributor

mhorne commented Mar 12, 2026

I'll update the docs for hwpmc in this patch. I'm still holding a few code patches that need to land to unblock a few other external collaborators. Once I get those out this week, I'll make my final pass on my hwpmc amd/ibs docs and push those too.

Sounds great, many thanks.

Copy link
Contributor

@mhorne mhorne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I will merge today.

freebsd-git pushed a commit that referenced this pull request Mar 16, 2026
This change allows for fine-grained capabilities per counter index. This
is particularly useful for AMD where subclasses are not exposed to the
general PMC code, but other architectures also have asymmetric behaviors
when it comes to specific counter indices.

A new PMC_OP_GETCAPS op is added to the hwpmc(4) ioctl interface.

Reviewed by:	mhorne
Sponsored by:	Netflix
Pull Request:	#2058
@mhorne
Copy link
Contributor

mhorne commented Mar 16, 2026

Merged with some small minor tweaks to style (argument order) and to the commit message.

@mhorne mhorne closed this Mar 16, 2026
@mhorne mhorne added the merged Closed commit that's been merged label Mar 16, 2026
@mhorne
Copy link
Contributor

mhorne commented Mar 16, 2026

As a follow-up I bumped PMC_VERSION_MINOR in sys/pmc.h. We don't maintain this carefully but it definitely makes sense here.

This change allows for fine-grained capabilities per counter index.
This is particularly useful for AMD where subclasses are not exposed to
the general PMC code, but other architectures also have assymetric
behaviors when it comes to specific counter indicies.

Sponsored by: Netflix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged Closed commit that's been merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants