github.com/castai/kvisor@v1.7.1-0.20240516114728-b3572a2607b5/pkg/ebpftracer/c/headers/common/bpf_prog.h (about)

     1  #ifndef __COMMON_PROG_H__
     2  #define __COMMON_PROG_H__
     3  
     4  #include <vmlinux.h>
     5  
     6  #include <common/common.h>
     7  
     8  // CONSTANTS
     9  
    10  #define BPF_PROG_LOAD 5
    11  
    12  // PROTOTYPES
    13  
    14  statfunc u32 get_attr_insn_cnt(union bpf_attr *);
    15  statfunc const struct bpf_insn *get_attr_insns(union bpf_attr *);
    16  
    17  // FUNCTIONS
    18  
    19  statfunc u32 get_attr_insn_cnt(union bpf_attr *attr)
    20  {
    21      return BPF_CORE_READ(attr, insn_cnt);
    22  }
    23  
    24  statfunc const struct bpf_insn *get_attr_insns(union bpf_attr *attr)
    25  {
    26      return (const struct bpf_insn *) BPF_CORE_READ(attr, insns);
    27  }
    28  
    29  #endif