summaryrefslogtreecommitdiff
path: root/samples/bpf/tracex7_user.c
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2024-10-11 04:48:47 +0000
committerAlexei Starovoitov <ast@kernel.org>2024-10-11 09:51:31 -0700
commit118740b870157eacd974c9120d27c20b5663b47a (patch)
treef8984933bb944d10d52b375612f252f6ae79e1c9 /samples/bpf/tracex7_user.c
parent5ea68f0493d192610fa29fc9a7dcd9038fa8d5ee (diff)
samples/bpf: remove obsolete tracing related tests
The samples/bpf has become outdated and often does not follow up with the latest. This commit removes obsolete tracing-related tests. Specifically, 'test_overhead' is duplicate with selftests (and bench), and 'test_override_return', 'test_probe_write_user' tests are obsolete since they have been replaced by kprobe_multi_override and probe_user from selftests respectively. The following files are removed: - test_overhead: tests the overhead of BPF programs with task_rename, now covered by selftests and benchmark tests (rename-*). [1] - test_override_return: tests the return override functionality, now handled by kprobe_multi_override in selftests. - test_probe_write_user: tests the probe_write_user functionality, now replaced by the probe_user test in selftests. This cleanup will help to streamline the testing framework by removing redundant tests. [1]: https://patchwork.kernel.org/cover/13759916 Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Link: https://lore.kernel.org/r/20241011044847.51584-5-danieltimlee@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/tracex7_user.c')
-rw-r--r--samples/bpf/tracex7_user.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/samples/bpf/tracex7_user.c b/samples/bpf/tracex7_user.c
deleted file mode 100644
index b10b5e03a226..000000000000
--- a/samples/bpf/tracex7_user.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <unistd.h>
-#include <bpf/libbpf.h>
-
-int main(int argc, char **argv)
-{
- struct bpf_link *link = NULL;
- struct bpf_program *prog;
- struct bpf_object *obj;
- char filename[256];
- char command[256];
- int ret = 0;
- FILE *f;
-
- if (!argv[1]) {
- fprintf(stderr, "ERROR: Run with the btrfs device argument!\n");
- return 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");
- return 0;
- }
-
- prog = bpf_object__find_program_by_name(obj, "bpf_prog1");
- if (!prog) {
- fprintf(stderr, "ERROR: finding a prog in obj file failed\n");
- goto cleanup;
- }
-
- /* load BPF program */
- if (bpf_object__load(obj)) {
- fprintf(stderr, "ERROR: loading BPF object file failed\n");
- goto cleanup;
- }
-
- link = bpf_program__attach(prog);
- if (libbpf_get_error(link)) {
- fprintf(stderr, "ERROR: bpf_program__attach failed\n");
- link = NULL;
- goto cleanup;
- }
-
- snprintf(command, 256, "mount %s tmpmnt/", argv[1]);
- f = popen(command, "r");
- ret = pclose(f);
-
-cleanup:
- bpf_link__destroy(link);
- bpf_object__close(obj);
- return ret ? 0 : 1;
-}