Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumerize tracepoint categories as described in #314 #1114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

syogaraj
Copy link
Contributor

@syogaraj syogaraj commented Mar 6, 2025

  1. Used trace-cmd list -e for the list of tracepoint categories.
  2. Tracepoint now has its own file (tracepoint.rs). Hence, removed TracepointOpts from program.rs and placed it in tracepoint.rs.

Copy link
Collaborator

@danielocfb danielocfb left a comment

Choose a reason for hiding this comment

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

Nice! Would you mind splitting this into two commits, first the introduction of the tracepoint module and the move of TracepointOpts and then the addition of TracepointCategory? Also, please take a look at my comment for the Unknown variant.

@syogaraj syogaraj force-pushed the tracepoint branch 2 times, most recently from 65f95e5 to 9302957 Compare March 7, 2025 03:13
Copy link
Contributor

@chenhengqi chenhengqi left a comment

Choose a reason for hiding this comment

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

Looks good overall. But first commit is incomplete, you can't not refer to TracepointCategory::Syscalls defined in the second commit.

#[non_exhaustive]
#[repr(u32)]
#[derive(Debug)]
pub enum TracepointCategory {
Copy link
Contributor

Choose a reason for hiding this comment

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

A second thought. Could we just add some generic categories ? No arch-specific, No driver-specific.
See https://github.com/torvalds/linux/tree/master/include/trace/events

Copy link
Collaborator

Choose a reason for hiding this comment

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

You are saying remove everything that is arch or driver specific? I have no strong preference, but to me that seems like a moving target: over time something may become generic. It also seems somewhat arbitrary and ultimately we just provide possible values, but runtime detection by the kernel should have the last say anyway. So personally I guess I'd err on the side of making more values available.

Copy link
Contributor

Choose a reason for hiding this comment

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

This list seems taken from some random running machine, especially the amdcpu thing.

There are tens of arch and thousands of drivers, trying to keep them here also a moving target.

@danielocfb
Copy link
Collaborator

But first commit is incomplete, you can't not refer to TracepointCategory::Syscalls defined in the second commit.

Yeah, that's a good catch. Can you please fix that up and make sure everything builds at each point, @syogaraj ?

@danielocfb
Copy link
Collaborator

I see there are some conflicts with the merged #1115. I believe they should be fairly mechanical to resolve, though. Sorry about that, but we'd have conflicts either way.

@syogaraj
Copy link
Contributor Author

syogaraj commented Mar 8, 2025

But first commit is incomplete, you can't not refer to TracepointCategory::Syscalls defined in the second commit.

Yeah, that's a good catch. Can you please fix that up and make sure everything builds at each point, @syogaraj ?

Missed this @chenhengqi. fixed them now. @danielocfb

I see there are some conflicts with the merged #1115. I believe they should be fairly mechanical to resolve, though. Sorry about that, but we'd have conflicts either way.

@danielocfb, Resolved the merge conflict from #1115 and moved RawTracepointOpts to tracepoint module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants