1a0964f52SAndrii Nakryiko // SPDX-License-Identifier: GPL-2.0 2a0964f52SAndrii Nakryiko /* Copyright (c) 2021 Facebook */ 3a0964f52SAndrii Nakryiko 4a0964f52SAndrii Nakryiko #include <linux/bpf.h> 5a0964f52SAndrii Nakryiko #include <bpf/bpf_helpers.h> 6a0964f52SAndrii Nakryiko 7256eab48SAndrii Nakryiko /* 8-byte aligned .data */ 8256eab48SAndrii Nakryiko static volatile long static_var1 = 2; 9256eab48SAndrii Nakryiko static volatile int static_var2 = 3; 10*9e9b4515SAndrii Nakryiko int var1 = -1; 11a0964f52SAndrii Nakryiko /* 4-byte aligned .rodata */ 12a0964f52SAndrii Nakryiko const volatile int rovar1; 13a0964f52SAndrii Nakryiko 14a0964f52SAndrii Nakryiko /* same "subprog" name in both files */ subprog(int x)15a0964f52SAndrii Nakryikostatic __noinline int subprog(int x) 16a0964f52SAndrii Nakryiko { 17a0964f52SAndrii Nakryiko /* but different formula */ 18a0964f52SAndrii Nakryiko return x * 2; 19a0964f52SAndrii Nakryiko } 20a0964f52SAndrii Nakryiko 21a0964f52SAndrii Nakryiko SEC("raw_tp/sys_enter") handler1(const void * ctx)22a0964f52SAndrii Nakryikoint handler1(const void *ctx) 23a0964f52SAndrii Nakryiko { 24256eab48SAndrii Nakryiko var1 = subprog(rovar1) + static_var1 + static_var2; 25a0964f52SAndrii Nakryiko 26a0964f52SAndrii Nakryiko return 0; 27a0964f52SAndrii Nakryiko } 28a0964f52SAndrii Nakryiko 29a0964f52SAndrii Nakryiko char LICENSE[] SEC("license") = "GPL"; 30a0964f52SAndrii Nakryiko int VERSION SEC("version") = 1; 31