...

Text file src/github.com/cilium/ebpf/testdata/freplace.c

Documentation: github.com/cilium/ebpf/testdata

     1// /* This file excercises freplace. */
     2
     3#include "common.h"
     4
     5char __license[] __section("license") = "MIT";
     6
     7struct bpf_args {
     8	uint64_t args[0];
     9};
    10
    11__attribute__((noinline)) int subprog() {
    12	volatile int ret = 0;
    13	return ret;
    14}
    15
    16__section("raw_tracepoint/sched_process_exec") int sched_process_exec(struct bpf_args *ctx) {
    17	return subprog();
    18}
    19
    20__section("freplace/subprog") int replacement() {
    21	return 0;
    22}

View as plain text