brintos

brintos / linux-shallow public Read only

0
0
Text · 685 B · 766ebd5 Raw
32 lines · c
1// SPDX-License-Identifier: GPL-2.02/* Copyright (c) 2021 Facebook */3 4#include <linux/bpf.h>5#include <bpf/bpf_helpers.h>6 7/* 4-byte aligned .data */8static volatile int static_var1 = 5;9static volatile int static_var2 = 6;10int var2 = -1;11/* 8-byte aligned .rodata */12const volatile long rovar2;13 14/* same "subprog" name in both files */15static __noinline int subprog(int x)16{17	/* but different formula */18	return x * 3;19}20 21SEC("raw_tp/sys_enter")22int handler2(const void *ctx)23{24	var2 = subprog(rovar2) + static_var1 + static_var2;25 26	return 0;27}28 29/* different name and/or type of the variable doesn't matter */30char _license[] SEC("license") = "GPL";31int _version SEC("version") = 1;32