3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-19 13:45:54 +00:00
Brooklyn/tools/testing/selftests/bpf/progs/test_ksyms_module.c

27 lines
466 B
C
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include "vmlinux.h"
2022-03-15 21:16:25 +05:00
#include <bpf/bpf_helpers.h>
extern const int bpf_testmod_ksym_percpu __ksym;
2022-03-15 21:16:25 +05:00
int out_mod_ksym_global = 0;
bool triggered = false;
2022-03-15 21:16:25 +05:00
SEC("raw_tp/sys_enter")
int handler(const void *ctx)
{
2022-03-15 21:16:25 +05:00
int *val;
__u32 cpu;
val = (int *)bpf_this_cpu_ptr(&bpf_testmod_ksym_percpu);
out_mod_ksym_global = *val;
triggered = true;
return 0;
}
char LICENSE[] SEC("license") = "GPL";