delve/pkg/proc/internal/ebpf/bpf/include/trace.bpf.h
Hengqi Chen 64d5ce26d6
proc: Simplify eBPF backend implementation (#3325)
* Remove standard C headers since we have vmlinux.h already
* Simplify get_goroutine_id() implementation, this reduces a map
  and thus reduces runtime memory comsumption.

While at it, unify all indention using 4 spaces.

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
2023-04-24 13:37:58 -07:00

22 lines
623 B
C

#include "vmlinux.h"
#include "function_vals.bpf.h"
#include <bpf/bpf_core_read.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#define BPF_MAX_VAR_SIZ (1 << 29)
// Ring buffer to handle communication of variable values back to userspace.
struct {
__uint(type, BPF_MAP_TYPE_RINGBUF);
__uint(max_entries, BPF_MAX_VAR_SIZ);
} events SEC(".maps");
// Map which uses instruction address as key and function parameter info as the value.
struct {
__uint(max_entries, 42);
__uint(type, BPF_MAP_TYPE_HASH);
__type(key, u64);
__type(value, function_parameter_list_t);
} arg_map SEC(".maps");