iovisor / iovisor/bcc

EOPNOTSUPP error at bpf_perf_event_output function

Open
#2,857 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
5d 13h
Merged PRs (30d)
3

Description

I'm trying to make the c-based eBPF program.

I attach the kprobe on bio_endio function.
Then I tried to pass my structure to user space.
(I follow the samples/bpf/trace_output example.)

but bpf_perf_event_output returns -EOPNOTSUPP Error.

> bpf_perf_event_output(ctx, &result_map, 0, &result, sizeof(result);

result structure consists of (five u64 var + five u32 var + one char[16]).

> struct bpf_map_def SEC("maps") result_map = {
> .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
> .key_size = sizeof(int),
> .value_size = sizeof(u32),
> .max_entries = 2,
> };

If you know the solution, please help me.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with samples/bpf/trace_output and compare its bpf_perf_event_output usage with the kprobe on bio_endio, the result_map definition, and the reported result structure. Reproduce the -EOPNOTSUPP return and determine what differs in the program or context; done means the structure is passed to user space without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
observability-sre, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.