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

Add extra_flag option to bpf_attach_perf_event_raw #1765

Merged
merged 1 commit into from
May 17, 2018

Conversation

palmtenor
Copy link
Member

The bpf_attach_perf_event_raw API is designed to provide maximum flexibility for people to use advanced features of Kernel Perf Events with BPF. Some times specifying flags is necessary, such as if we want to use PERF_FLAG_PID_CGROUP to profile a container. This commit adds extra_flag option to C and C++ interface

I fee bad for the interface change after introducing the interface. However it was not so long time ago so I guess it should be find...:)

The bpf_attach_perf_event_raw API is designed to provide maximum
flexibility for people to use advanced features of Kernel Perf Events
with BPF. Some times specifying flags is neccesary, such as if we want
to use `PERF_FLAG_PID_CGROUP` to profile a container. This commit adds
`extra_flag` option to C and C++ interface
@yonghong-song
Copy link
Collaborator

@palmtenor do you think this extra_flags will be also useful for python scripts using raw_tracepoints? Adding this to python API as well to keep API parity between C++ and python?

@palmtenor
Copy link
Member Author

palmtenor commented May 17, 2018

@yonghong-song I think this is mainly targeting on the (hardware) Perf Event, not Raw Tracepoint (although it also uses Perf Event interface). We discussed that it might be harder for Python users to fine-tune the perf_event_attr struct, and that's not the normal use case in a Python script tool. I still feel the same way, what do you think?

@yonghong-song
Copy link
Collaborator

Sorry. I messed raw_tracepoints with attach_perf_event. Okay, let us only add the extra flags in C++ now. We can add to python API later if there is ever a need. Thanks!

@yonghong-song yonghong-song merged commit b8fccc5 into iovisor:master May 17, 2018
@palmtenor palmtenor deleted the extraflag branch July 10, 2018 21:28
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.

None yet

2 participants