Skip to content

Commit

Permalink
Add separate heap map for sock state change (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao authored May 24, 2024
1 parent 089e7e5 commit b7d02a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkg/ebpftracer/c/headers/common/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ struct {
__type(value, event_data_t); // ... linked to a scratch area
} net_heap_event SEC(".maps");

struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1); // simultaneous softirqs running per CPU (?)
__type(key, u32); // per cpu index ... (always zero)
__type(value, event_data_t); // ... linked to a scratch area
} net_heap_sock_state_event SEC(".maps");

// CONSTANTS

// Network return value (retval) codes
Expand Down
2 changes: 1 addition & 1 deletion pkg/ebpftracer/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7073,7 +7073,7 @@ int trace_inet_sock_set_state(struct bpf_raw_tracepoint_args *ctx)
}

u32 zero = 0;
event_data_t *e = bpf_map_lookup_elem(&net_heap_event, &zero);
event_data_t *e = bpf_map_lookup_elem(&net_heap_sock_state_event, &zero);
if (unlikely(e == NULL))
return 0;

Expand Down
3 changes: 3 additions & 0 deletions pkg/ebpftracer/tracer_arm64_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpftracer/tracer_arm64_bpfel.o
Binary file not shown.
3 changes: 3 additions & 0 deletions pkg/ebpftracer/tracer_x86_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpftracer/tracer_x86_bpfel.o
Binary file not shown.

0 comments on commit b7d02a4

Please sign in to comment.