test_subskeleton.c (589B)
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (c) Meta Platforms, Inc. and affiliates. */ 3 4#include <stdbool.h> 5#include <linux/bpf.h> 6#include <bpf/bpf_helpers.h> 7 8/* volatile to force a read, compiler may assume 0 otherwise */ 9const volatile int rovar1; 10int out1; 11 12/* Override weak symbol in test_subskeleton_lib */ 13int var5 = 5; 14 15extern volatile bool CONFIG_BPF_SYSCALL __kconfig; 16 17extern int lib_routine(void); 18 19SEC("raw_tp/sys_enter") 20int handler1(const void *ctx) 21{ 22 (void) CONFIG_BPF_SYSCALL; 23 24 out1 = lib_routine() * rovar1; 25 return 0; 26} 27 28char LICENSE[] SEC("license") = "GPL";