]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/bpf: Fix open-coded gettid syscall in uprobe syscall tests
authorJiri Olsa <jolsa@kernel.org>
Wed, 1 Oct 2025 12:22:21 +0000 (14:22 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 1 Oct 2025 20:37:29 +0000 (13:37 -0700)
Commit 0e2fb011a0ba ("selftests/bpf: Clean up open-coded gettid syscall
invocations") addressed the issue that older libc may not have a gettid()
function call wrapper for the associated syscall.

The uprobe syscall tests got in from tip tree, using sys_gettid in there.

Fixes: 0e2fb011a0ba ("selftests/bpf: Clean up open-coded gettid syscall invocations")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c

index 6d75ede16e7cedf9c2bbcb286da14f6375e0b325..955a37751b52d56c56dfbaa496bf75eabcdaaeba 100644 (file)
@@ -661,7 +661,7 @@ static void *worker_trigger(void *arg)
                rounds++;
        }
 
-       printf("tid %d trigger rounds: %lu\n", gettid(), rounds);
+       printf("tid %ld trigger rounds: %lu\n", sys_gettid(), rounds);
        return NULL;
 }
 
@@ -704,7 +704,7 @@ static void *worker_attach(void *arg)
                rounds++;
        }
 
-       printf("tid %d attach rounds: %lu hits: %d\n", gettid(), rounds, skel->bss->executed);
+       printf("tid %ld attach rounds: %lu hits: %d\n", sys_gettid(), rounds, skel->bss->executed);
        uprobe_syscall_executed__destroy(skel);
        free(ref);
        return NULL;