Files
linux/tools/testing/selftests/bpf/prog_tests/raw_tp_null.c
Kumar Kartikeya Dwivedi 0da1955b5b selftests/bpf: Add tests for raw_tp NULL args
Add tests to ensure that arguments are correctly marked based on their
specified positions, and whether they get marked correctly as maybe
null. For modules, all tracepoint parameters should be marked
PTR_MAYBE_NULL by default.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20241213221929.3495062-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2024-12-13 16:24:53 -08:00

29 lines
643 B
C

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "raw_tp_null.skel.h"
#include "raw_tp_null_fail.skel.h"
void test_raw_tp_null(void)
{
struct raw_tp_null *skel;
RUN_TESTS(raw_tp_null_fail);
skel = raw_tp_null__open_and_load();
if (!ASSERT_OK_PTR(skel, "raw_tp_null__open_and_load"))
return;
skel->bss->tid = sys_gettid();
if (!ASSERT_OK(raw_tp_null__attach(skel), "raw_tp_null__attach"))
goto end;
ASSERT_OK(trigger_module_test_read(2), "trigger testmod read");
ASSERT_EQ(skel->bss->i, 3, "invocations");
end:
raw_tp_null__destroy(skel);
}