samples/bpf: change _kern suffix to .bpf with BPF test programs
authorDaniel T. Lee <danieltimlee@gmail.com>
Sun, 15 Jan 2023 07:16:13 +0000 (16:16 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Jan 2023 21:32:45 +0000 (13:32 -0800)
This commit changes the _kern suffix to .bpf with the BPF test programs.
With this modification, test programs will inherit the benefit of the
new CLANG-BPF compile target.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Link: https://lore.kernel.org/r/20230115071613.125791-11-danieltimlee@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
13 files changed:
samples/bpf/Makefile
samples/bpf/lwt_len_hist.bpf.c [moved from samples/bpf/lwt_len_hist_kern.c with 100% similarity]
samples/bpf/lwt_len_hist.sh
samples/bpf/sock_flags.bpf.c [moved from samples/bpf/sock_flags_kern.c with 100% similarity]
samples/bpf/test_cgrp2_sock2.sh
samples/bpf/test_cgrp2_tc.bpf.c [moved from samples/bpf/test_cgrp2_tc_kern.c with 100% similarity]
samples/bpf/test_cgrp2_tc.sh
samples/bpf/test_map_in_map.bpf.c [moved from samples/bpf/test_map_in_map_kern.c with 100% similarity]
samples/bpf/test_map_in_map_user.c
samples/bpf/test_overhead_kprobe.bpf.c [moved from samples/bpf/test_overhead_kprobe_kern.c with 100% similarity]
samples/bpf/test_overhead_raw_tp.bpf.c [moved from samples/bpf/test_overhead_raw_tp_kern.c with 100% similarity]
samples/bpf/test_overhead_tp.bpf.c [moved from samples/bpf/test_overhead_tp_kern.c with 100% similarity]
samples/bpf/test_overhead_user.c

index 22039a0..615f24e 100644 (file)
@@ -131,7 +131,7 @@ always-y += tracex4_kern.o
 always-y += tracex5_kern.o
 always-y += tracex6_kern.o
 always-y += tracex7_kern.o
-always-y += sock_flags_kern.o
+always-y += sock_flags.bpf.o
 always-y += test_probe_write_user.bpf.o
 always-y += trace_output.bpf.o
 always-y += tcbpf1_kern.o
@@ -140,19 +140,19 @@ always-y += lathist_kern.o
 always-y += offwaketime_kern.o
 always-y += spintest_kern.o
 always-y += map_perf_test.bpf.o
-always-y += test_overhead_tp_kern.o
-always-y += test_overhead_raw_tp_kern.o
-always-y += test_overhead_kprobe_kern.o
+always-y += test_overhead_tp.bpf.o
+always-y += test_overhead_raw_tp.bpf.o
+always-y += test_overhead_kprobe.bpf.o
 always-y += parse_varlen.o parse_simple.o parse_ldabs.o
-always-y += test_cgrp2_tc_kern.o
+always-y += test_cgrp2_tc.bpf.o
 always-y += xdp1_kern.o
 always-y += xdp2_kern.o
 always-y += test_current_task_under_cgroup.bpf.o
 always-y += trace_event_kern.o
 always-y += sampleip_kern.o
-always-y += lwt_len_hist_kern.o
+always-y += lwt_len_hist.bpf.o
 always-y += xdp_tx_iptunnel_kern.o
-always-y += test_map_in_map_kern.o
+always-y += test_map_in_map.bpf.o
 always-y += tcp_synrto_kern.o
 always-y += tcp_rwnd_kern.o
 always-y += tcp_bufs_kern.o
index ff7d1ba..7078bfc 100755 (executable)
@@ -4,7 +4,7 @@
 NS1=lwt_ns1
 VETH0=tst_lwt1a
 VETH1=tst_lwt1b
-BPF_PROG=lwt_len_hist_kern.o
+BPF_PROG=lwt_len_hist.bpf.o
 TRACE_ROOT=/sys/kernel/debug/tracing
 
 function cleanup {
index 00cc8d1..82acff9 100755 (executable)
@@ -5,7 +5,7 @@ BPFFS=/sys/fs/bpf
 MY_DIR=$(dirname $0)
 TEST=$MY_DIR/test_cgrp2_sock2
 LINK_PIN=$BPFFS/test_cgrp2_sock2
-BPF_PROG=$MY_DIR/sock_flags_kern.o
+BPF_PROG=$MY_DIR/sock_flags.bpf.o
 
 function config_device {
        ip netns add at_ns0
index 37a2c9c..38e8dbc 100755 (executable)
@@ -4,7 +4,7 @@
 MY_DIR=$(dirname $0)
 # Details on the bpf prog
 BPF_CGRP2_ARRAY_NAME='test_cgrp2_array_pin'
-BPF_PROG="$MY_DIR/test_cgrp2_tc_kern.o"
+BPF_PROG="$MY_DIR/test_cgrp2_tc.bpf.o"
 BPF_SECTION='filter'
 
 [ -z "$TC" ] && TC='tc'
index 652ec72..9e79df4 100644 (file)
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
        struct bpf_object *obj;
        char filename[256];
 
-       snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
+       snprintf(filename, sizeof(filename), "%s.bpf.o", argv[0]);
        obj = bpf_object__open_file(filename, NULL);
        if (libbpf_get_error(obj)) {
                fprintf(stderr, "ERROR: opening BPF object file failed\n");
index ce28d30..dbd86f7 100644 (file)
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
 
        if (test_flags & 0xC) {
                snprintf(filename, sizeof(filename),
-                        "%s_kprobe_kern.o", argv[0]);
+                        "%s_kprobe.bpf.o", argv[0]);
 
                printf("w/KPROBE\n");
                err = load_progs(filename);
@@ -201,7 +201,7 @@ int main(int argc, char **argv)
 
        if (test_flags & 0x30) {
                snprintf(filename, sizeof(filename),
-                        "%s_tp_kern.o", argv[0]);
+                        "%s_tp.bpf.o", argv[0]);
                printf("w/TRACEPOINT\n");
                err = load_progs(filename);
                if (!err)
@@ -212,7 +212,7 @@ int main(int argc, char **argv)
 
        if (test_flags & 0xC0) {
                snprintf(filename, sizeof(filename),
-                        "%s_raw_tp_kern.o", argv[0]);
+                        "%s_raw_tp.bpf.o", argv[0]);
                printf("w/RAW_TRACEPOINT\n");
                err = load_progs(filename);
                if (!err)