You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
Hey all, I've been digging around the redbpf source today, trying to track down a way to use it to map an ebpf program to a regular old perf event (a hardware event in my case). In the Python BCC library, you can use attach_perf_event_raw and map a perf_event_attr to a function:
prog_text="""int hw_event(struct bpf_perf_event_data *ctx) { // do stuff with `ctx`}"""attr=Perf.perf_event_attr()
attr.type=PerfType.RAW# hw_hexcode here is the perf event + maskattr.config=int(hw_hexcode, 16)
b=BPF(text=prog_text)
b.attach_perf_event_raw(perf_event_attr=attr, fn_name=hw_event, pid=pid, cpu=cpu)
How might I do this with redbpf?
The text was updated successfully, but these errors were encountered:
as far as I know redBPF does not support raw tracepoints at this time. I had a look at the requirements and it does not look to be terribly different from what we already have, so likely doable, but it just isn't there at this time.
I am not a maintainer of redBPF, but sure go ahead. From my experience the maintainers do review and merge code.
Revisiting the original question, I think I misread it. I thought about raw tracepoints, but it looks like the actual question was about BPF_PROG_TYPE_PERF_EVENT (perf event programs). I don't remember redBPF support for these either.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey all, I've been digging around the redbpf source today, trying to track down a way to use it to map an ebpf program to a regular old perf event (a hardware event in my case). In the Python BCC library, you can use
attach_perf_event_raw
and map aperf_event_attr
to a function:How might I do this with redbpf?
The text was updated successfully, but these errors were encountered: