instruction stringlengths 82 202 | input stringclasses 1
value | output stringlengths 73 23.9M |
|---|---|---|
Linux kernel'inin 'tools/testing/selftests/bpf/progs/test_ringbuf_n' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2024 Andrea Righi <andrea.righi@canonical.com>
#include <linux/bpf.h>
#include <sched.h>
#include <unistd.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
char _license[] SEC("license") = "GPL";
#define TASK_COMM_LEN 16
struct sample {
int pid;
long v... | |
Linux kernel'inin 'tools/testing/selftests/bpf/progs/lpm_trie_bench' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Cloudflare */
#include <vmlinux.h>
#include <errno.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_core_read.h>
#include "bpf_misc.h"
#include "bpf_atomic.h"
#include "progs/lpm_trie.h"
#define BPF_OBJ_NAME_LEN 16U
#define M... | |
Linux kernel'inin 'tools/testing/selftests/bpf/progs/test_l4lb_noinline' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017 Facebook
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include <linux/pkt_cls.h>
#include <linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/icmp.h>
#include <linux/i... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright 2022 Sony Group Corporation */
#define _GNU_SOURCE
#include <fcntl.h>
#include <sys/prctl.h>
#include <test_progs.h>
#include "bpf_syscall_macro.skel.h"
void test_bpf_syscall_macro(void)
{
struct bpf_syscall_macro *skel = NULL;
int err;
int exp_arg1 = 1001;
uns... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/xdp_attach' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "test_xdp_attach_fail.skel.h"
#define IFINDEX_LO 1
#define XDP_FLAGS_REPLACE (1U << 4)
static void test_xdp_attach(const char *file)
{
__u32 duration = 0, id1, id2, id0 = 0, len;
struct bpf_object *obj1, *obj2, *obj3;
struct bpf_prog_info i... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/linked_maps' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <test_progs.h>
#include <sys/syscall.h>
#include "linked_maps.skel.h"
void test_linked_maps(void)
{
int err;
struct linked_maps *skel;
skel = linked_maps__open_and_load();
if (!ASSERT_OK_PTR(skel, "skel_open"))
return;
err = ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/snprintf_btf' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <linux/btf.h>
#include "netif_receive_skb.skel.h"
/* Demonstrate that bpf_snprintf_btf succeeds and that various data types
* are formatted correctly.
*/
void serial_test_snprintf_btf(void)
{
struct netif_receive_skb *skel;
struct netif_rece... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/resolve_btfids' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
#include <string.h>
#include <bpf/btf.h>
#include <bpf/libbpf.h>
#include <linux/btf.h>
#include <linux/kernel.h>
#define CONFIG_DEBUG_INFO_BTF
#include <linux/btf_ids.h>
#include "test_progs.h"
static int duration;
struct symbol {
const char *name;
i... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/arena_strsearch' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "arena_strsearch.skel.h"
static void test_arena_str(void)
{
LIBBPF_OPTS(bpf_test_run_opts, opts);
struct arena_strsearch *skel;
int ret;
skel = arena_strsearch__open_and_load();
... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sk_storage_omem_uncharge' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2023 Facebook */
#include <test_progs.h>
#include <bpf/libbpf.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "sk_storage_omem_uncharge.skel.h"
void test_sk_storage_omem_uncharge(void)
{
struct sk_storage_omem_uncharge *skel;
int sk_fd = -1, map_fd... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/perf_buffer' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <pthread.h>
#include <sched.h>
#include <sys/socket.h>
#include <test_progs.h>
#include "test_perf_buffer.skel.h"
#include "bpf/libbpf_internal.h"
static int duration;
/* AddressSanitizer sometimes crashes due to data dereference below, due to
* t... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/syscall' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <test_progs.h>
#include "syscall.skel.h"
struct args {
__u64 log_buf;
__u32 log_size;
int max_entries;
int map_fd;
int prog_fd;
int btf_fd;
};
static void test_syscall_load_prog(void)
{
static char verifier_log[8192];
struct a... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/async_stack_depth' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "async_stack_depth.skel.h"
void test_async_stack_depth(void)
{
RUN_TESTS(async_stack_depth);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/kfunc_implicit_args' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "kfunc_implicit_args.skel.h"
void test_kfunc_implicit_args(void)
{
RUN_TESTS(kfunc_implicit_args);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/percpu_alloc' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "cgroup_helpers.h"
#include "percpu_alloc_array.skel.h"
#include "percpu_alloc_cgrp_local_storage.skel.h"
#include "percpu_alloc_fail.skel.h"
static void test_array(void)
{
struct percpu_alloc_array *skel;
int err, prog_fd;
LIBBPF_OPTS(bpf_te... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/assign_reuse' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2023 Isovalent */
#include <uapi/linux/if_link.h>
#include <test_progs.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include "network_helpers.h"
#include "test_assign_reuse.skel.h"
#define NS_TEST "assign_reuse"
#define LOOPBACK 1
#define PORT 4443
s... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/flow_dissector_classification' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <bpf/bpf.h>
#include <linux/bpf.h>
#include <bpf/libbpf.h>
#include <arpa/inet.h>
#include <asm/byteorder.h>
#include <netinet/udp.h>
#include <poll.h>
#include <string.h>
#include <sys/ioc... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "struct_ops_private_stack.skel.h"
#include "struct_ops_private_stack_fail.skel.h"
#include "struct_ops_private_stack_recur.skel.h"
#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
static void test_private_stack(void)
{
... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/btf_field_iter' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024, Oracle and/or its affiliates. */
#include <test_progs.h>
#include <bpf/btf.h>
#include "btf_helpers.h"
#include "bpf/libbpf_internal.h"
struct field_data {
__u32 ids[5];
const char *strs[5];
} fields[] = {
{ .ids = {}, .strs = {} },
{ .ids = {}, .s... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/pro_epilogue' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "pro_epilogue.skel.h"
#include "epilogue_tailcall.skel.h"
#include "pro_epilogue_goto_start.skel.h"
#include "epilogue_exit.skel.h"
#include "pro_epilogue_with_kfunc.skel.h"
str... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/probe_read_user_str' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "test_probe_read_user_str.skel.h"
static const char str1[] = "mestring";
static const char str2[] = "mestringalittlebigger";
static const char str3[] = "mestringblubblubblubblubblub";
static int test_one_str(struct test_probe_read_user_str *ske... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/get_func_ip_test' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "get_func_ip_test.skel.h"
#include "get_func_ip_uprobe_test.skel.h"
#include "get_func_ip_fsession_test.skel.h"
static noinline void uprobe_trigger(void)
{
}
static void test_function_entry(void)
{
struct get_func_ip_test *skel = NULL;
int er... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#define _GNU_SOURCE
#include <sched.h>
#include <test_progs.h>
#include "network_helpers.h"
#include "bpf_dctcp.skel.h"
#include "bpf_cubic.skel.h"
#include "bpf_iter_setsockopt.skel.h"
static int create_netns(void)
{
if (!ASSERT_OK(unshare(CL... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/section_names' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018 Facebook
#include <test_progs.h>
static int duration = 0;
struct sec_name_test {
const char sec_name[32];
struct {
int rc;
enum bpf_prog_type prog_type;
enum bpf_attach_type expected_attach_type;
} expected_load;
struct {
int rc;
enum bpf_at... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/pkt_access' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
void test_pkt_access(void)
{
const char *file = "./test_pkt_access.bpf.o";
struct bpf_object *obj;
int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts,
.data_in = &pkt_v4,
.data_size_in = sizeof(pkt_v4),
.repeat ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/cgroup_dev' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <errno.h>
#include "test_progs.h"
#include "cgroup_helpers.h"
#include "dev_cgroup.skel.h"
#define TEST_CGROUP "/test-bpf-based-device-cgroup/"
#define TEST_BUFFER_SIZE 64
static void test_mknod(const char *path, mode_... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/ksyms_module' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <test_progs.h>
#include <network_helpers.h>
#include "test_ksyms_module.lskel.h"
#include "test_ksyms_module.skel.h"
static void test_ksyms_module_lskel(void)
{
struct test_ksyms_module_lskel *skel;
int err;
LIBBPF_OPTS(bpf_test_ru... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bloom_filter_map' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <sys/syscall.h>
#include <limits.h>
#include <test_progs.h>
#include "bloom_filter_map.skel.h"
#ifndef NUMA_NO_NODE
#define NUMA_NO_NODE (-1)
#endif
static void test_fail_cases(void)
{
LIBBPF_OPTS(bpf_map_create_opts, opts);
__u32 ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bpf_obj_id' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#define nr_iters 2
void serial_test_bpf_obj_id(void)
{
const __u64 array_magic_value = 0xfaceb00c;
const __u32 array_key = 0;
const char *file = "./test_obj_id.bpf.o";
const char *expected_prog_name = "test_obj_id";
const char *expected_map_name = ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/summarization' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include "bpf/libbpf.h"
#include "summarization_freplace.skel.h"
#include "summarization.skel.h"
#include <test_progs.h>
static void print_verifier_log(const char *log)
{
if (env.verbosity >= VERBOSE_VERY)
fprintf(stdout, "VERIFIER LOG:\n=============\n%s=============\n", lo... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sock_create' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <linux/bpf.h>
#include <test_progs.h>
#include "cgroup_helpers.h"
static char bpf_log_buf[4096];
static bool verbose;
enum sock_create_test_error {
OK = 0,
DENY_CREATE,
};
static struct sock_create_test {
const char *descr;
const struct bpf_insn insns[64];
en... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/xdp_vlan' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/*
* Network topology:
* ----------- -----------
* | NS1 | | NS2 |
* | veth0 -|--------|- veth0 |
* ----------- -----------
*
*/
#define _GNU_SOURCE
#include <net/if.h>
#include <uapi/linux/if_link.h>
#include "network_helpers.h"
#inc... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/tcp_rtt' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <test_progs.h>
#include "cgroup_helpers.h"
#include "network_helpers.h"
#include "tcp_rtt.skel.h"
struct tcp_rtt_storage {
__u32 invoked;
__u32 dsack_dups;
__u32 delivered;
__u32 delivered_ce;
__u32 icsk_retransmits;
__u32 mrtt_us; /* args[0]... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_struct_ops_multi_args' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "struct_ops_multi_args.skel.h"
void test_struct_ops_multi_args(void)
{
RUN_TESTS(struct_ops_multi_args);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/xsk' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <net/if.h>
#include <stdarg.h>
#include "network_helpers.h"
#include "test_progs.h"
#include "test_xsk.h"
#include "xsk_xdp_progs.skel.h"
#define VETH_RX "veth0"
#define VETH_TX "veth1"
#define MTU 1500
int setup_veth(bool busy_poll)
{
SYS(fail,
"ip link add %s num... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/preempted_bpf_ma_op' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2023. Huawei Technologies Co., Ltd */
#define _GNU_SOURCE
#include <sched.h>
#include <pthread.h>
#include <stdbool.h>
#include <test_progs.h>
#include "preempted_bpf_ma_op.skel.h"
#define ALLOC_THREAD_NR 4
#define ALLOC_LOOP_NR 512
struct alloc_ctx {
/* out... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/skc_to_unix_sock' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2021 Hengqi Chen */
#include <test_progs.h>
#include <sys/un.h>
#include "test_skc_to_unix_sock.skel.h"
static const char *sock_path = "@skc_to_unix_sock";
void test_skc_to_unix_sock(void)
{
struct test_skc_to_unix_sock *skel;
struct sockaddr_un sockaddr... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/xdp_flowtable' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
#include <bpf/btf.h>
#include <linux/if_link.h>
#include <netinet/udp.h>
#include <net/if.h>
#include <unistd.h>
#include "xdp_flowtable.skel.h"
#define TX_NETNS_NAME "ns0"
#define RX_NETNS_NAME "ns1"
#define TX_NAME "v0"
... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/libbpf_str' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
#include <ctype.h>
#include <test_progs.h>
#include <bpf/btf.h>
/*
* Utility function uppercasing an entire string.
*/
static void uppercase(char *s)
{
for (; *s != '\0'; s++)
*s = toupper(*s);
}
/*
* Test ca... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/core_autosize' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */
#include <test_progs.h>
#include <bpf/btf.h>
/* real layout and sizes according to test's (32-bit) BTF
* needs to be defined before skeleton is included */
struct test_struct___real {
unsigned int ptr; /* can't use `void *`, it is always 8 b... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/btf_kind' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2026, Oracle and/or its affiliates. */
#include <test_progs.h>
#include <bpf/btf.h>
#include <bpf/libbpf.h>
/* Verify kind encoding exists for each kind */
static void test_btf_kind_encoding(void)
{
LIBBPF_OPTS(btf_new_opts, opts);
const struct btf_header *h... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/compute_live_registers' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include "compute_live_registers.skel.h"
#include "test_progs.h"
void test_compute_live_registers(void)
{
RUN_TESTS(compute_live_registers);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/uprobe_autoattach' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022, Oracle and/or its affiliates. */
#include <test_progs.h>
#include "test_uprobe_autoattach.skel.h"
/* uprobe attach point */
static noinline int autoattach_trigger_func(int arg1, int arg2, int arg3,
int arg4, int arg5, int arg6,
int arg7... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 Facebook */
#include <linux/err.h>
#include <netinet/tcp.h>
#include <test_progs.h>
#include "network_helpers.h"
#include "bpf_dctcp.skel.h"
#include "bpf_cubic.skel.h"
#include "bpf_tcp_nogpl.skel.h"
#include "tcp_ca_update.skel.h"
#include "bpf_dctcp_rel... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/exhandler' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021, Oracle and/or its affiliates. */
#include <test_progs.h>
/* Test that verifies exception handling is working. fork()
* triggers task_newtask tracepoint; that new task will have a
* NULL pointer task_works, and the associated task->task_works->func
* s... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/cgroup_skb_sk_lookup' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 Facebook
#include <test_progs.h>
#include "network_helpers.h"
#include "cgroup_skb_sk_lookup_kern.skel.h"
static void run_lookup_test(__u16 *g_serv_port, int out_sk)
{
int serv_sk = -1, in_sk = -1, serv_in_sk = -1, err;
struct sockaddr_in6 addr = {};
... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/core_reloc' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <test_progs.h>
#include "progs/core_reloc_types.h"
#include "test_kmods/bpf_testmod.h"
#include <linux/limits.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <bpf/btf.h>
static int duration = 0;
#define STRUCT_TO_CHAR_PTR(struct_name) (c... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/probe_user' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
void test_probe_user(void)
{
static const char *const prog_names[] = {
"handle_sys_connect",
#if defined(__s390x__)
"handle_sys_socketcall",
#endif
};
enum { prog_count = ARRAY_SIZE(prog_names) };
const char *obj_file = "./test_probe_user.bpf.o";... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/map_lock' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <network_helpers.h>
static void *spin_lock_thread(void *arg)
{
int err, prog_fd = *(u32 *) arg;
LIBBPF_OPTS(bpf_test_run_opts, topts,
.data_in = &pkt_v4,
.data_size_in = sizeof(pkt_v4),
.repeat = 10000,
);
err = bpf_prog_test_run_opts... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/mptcp' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020, Tessares SA. */
/* Copyright (c) 2022, SUSE. */
#include <linux/const.h>
#include <netinet/in.h>
#include <test_progs.h>
#include <unistd.h>
#include <errno.h>
#include "cgroup_helpers.h"
#include "network_helpers.h"
#include "mptcp_sock.skel.h"
#include ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/exe_ctx' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2026 Valve Corporation.
* Author: Changwoo Min <changwoo@igalia.com>
*/
#include <test_progs.h>
#include <sys/syscall.h>
#include "test_ctx.skel.h"
void test_exe_ctx(void)
{
LIBBPF_OPTS(bpf_test_run_opts, opts);
cpu_set_t old_cpuset, target_cpuset;
str... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_struct_ops_id_ops_mapping' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "struct_ops_id_ops_mapping1.skel.h"
#include "struct_ops_id_ops_mapping2.skel.h"
static void test_st_ops_id_ops_mapping(void)
{
struct struct_ops_id_ops_mapping1 *skel1 = NULL;
struct struct_ops_id_ops_mapping2 *skel2 = NULL;
struct bpf_map_... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/xdp_synproxy' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause
/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
#define _GNU_SOURCE
#include <test_progs.h>
#include <network_helpers.h>
#include <ctype.h>
#define CMD_OUT_BUF_SIZE 1023
#define SYS_OUT(cmd, ...) ({ \
char buf[1024]; \
snprin... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/struct_ops_autocreate' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "struct_ops_autocreate.skel.h"
#include "struct_ops_autocreate2.skel.h"
static void cant_load_full_object(void)
{
struct struct_ops_autocreate *skel;
char *log = NULL;
int err;
skel = struct_ops_autocreate__open();
if (!ASSERT_OK_PTR(skel... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/flow_dissector' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <test_progs.h>
#include <network_helpers.h>
#include <linux/if_tun.h>
#include <sys/uio.h>
#include "bpf_flow.skel.h"
#define TEST_NS "flow_dissector_ns"
#define FLOW_CONTINUE_SADDR 0x7f00007f /* 127.0.0.127 */
#define TEST_NAME_MAX_LEN 64
#ifndef... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bpf_insn_array' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <bpf/bpf.h>
#include <test_progs.h>
#if defined(__x86_64__) || defined(__powerpc__) || defined(__aarch64__)
static int map_create(__u32 map_type, __u32 max_entries)
{
const char *map_name = "insn_array";
__u32 key_size = 4;
__u32 value_size = sizeof(struct bpf_insn... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sockopt_multi' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "cgroup_helpers.h"
#include "sockopt_multi.skel.h"
static int run_getsockopt_test(struct sockopt_multi *obj, int cg_parent,
int cg_child, int sock_fd)
{
struct bpf_link *link_parent = NULL;
struct bpf_link *link_child = NULL;
sockl... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/arena_spin_lock' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include <network_helpers.h>
#include <sys/sysinfo.h>
struct __qspinlock { int val; };
typedef struct __qspinlock arena_spinlock_t;
struct arena_qnode {
unsigned long next;
int count;
int ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sha256' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright 2025 Google LLC */
#include <test_progs.h>
#include "bpf/libbpf_internal.h"
#define MAX_LEN 4096
/* Test libbpf_sha256() for all lengths from 0 to MAX_LEN inclusively. */
void test_sha256(void)
{
/*
* The correctness of this value was verified by running ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/iters' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <unistd.h>
#include <malloc.h>
#include <stdlib.h>
#include <test_progs.h>
#include "cgroup_helpers.h"
#include "iters.skel.h"
#include "... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/atomics' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "atomics.lskel.h"
static void test_add(struct atomics_lskel *skel)
{
int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts);
/* No need to attach it, just run it directly */
prog_fd = skel->progs.add.prog_fd;
err = bpf_prog_test_run_opt... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/mem_rdonly_untrusted' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0-only
#include <test_progs.h>
#include "mem_rdonly_untrusted.skel.h"
void test_mem_rdonly_untrusted(void)
{
RUN_TESTS(mem_rdonly_untrusted);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_task_local_data' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <pthread.h>
#include <bpf/btf.h>
#include <test_progs.h>
/*
* Only a page is pinned to kernel, so the maximum amount of dynamic data
* allowed is page_size - sizeof(struct tld_data_u) - static TLD fields.
*/
#define TLD_DYN_DATA_SIZE_MAX (getpagesize() - sizeof(stru... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/global_func_args' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include "test_progs.h"
#include "network_helpers.h"
static __u32 duration;
static void test_global_func_args0(struct bpf_object *obj)
{
int err, i, map_fd, actual_value;
const char *map_name = "values";
map_fd = bpf_find_map(__func__, obj, map_name);
if (CHECK(map_fd < 0... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/fill_link_info' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2023 Yafang Shao <laoar.shao@gmail.com> */
#include <string.h>
#include <linux/bpf.h>
#include <linux/limits.h>
#include <test_progs.h>
#include "trace_helpers.h"
#include "test_fill_link_info.skel.h"
#include "bpf/libbpf_internal.h"
#define TP_CAT "sched"
#de... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/kprobe_multi_testmod_test' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "kprobe_multi.skel.h"
#include "trace_helpers.h"
#include "bpf/libbpf_internal.h"
static struct ksyms *ksyms;
static void kprobe_multi_testmod_check(struct kprobe_multi *skel)
{
ASSERT_EQ(skel->bss->kprobe_testmod_test1_result, 1, "kprobe_test... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bind_perm' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sched.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "test_progs.h"
#include "cap_helpers.h"
#include "bind_perm.skel.h"
static int create_netns(void)
{
if (!ASSERT_OK(unshare(CLONE_NEWNET), "create netns"))
retu... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/lwt_redirect' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Test suite of lwt_xmit BPF programs that redirect packets
* The file tests focus not only if these programs work as expected normally,
* but also if they can handle abnormal situations gracefully.
*
* WARNING
* -------
* This test suite may cras... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_task_work' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include <string.h>
#include <stdio.h>
#include "task_work.skel.h"
#include "task_work_fail.skel.h"
#include <linux/bpf.h>
#include <linux/perf_event.h>
#include <sys/syscall.h>
#include <time.... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sock_iter_batch' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2024 Meta
#include <poll.h>
#include <test_progs.h>
#include "network_helpers.h"
#include "sock_iter_batch.skel.h"
#define TEST_NS "sock_iter_batch_netns"
#define TEST_CHILD_NS "sock_iter_batch_child_netns"
static const int init_batch_size = 16;
static const ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_bpffs' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */
#define _GNU_SOURCE
#include <stdio.h>
#include <sched.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <test_progs.h>
/* TDIR must be in a location we can create a directory in. */
#define TDIR "/tmp/test_bpffs_t... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sock_fields' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 Facebook */
#define _GNU_SOURCE
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sched.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include <linux/compiler.h>
#inc... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_bprm_opts' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2020 Google LLC.
*/
#include <test_progs.h>
#include <linux/limits.h>
#include "bprm_opts.skel.h"
#include "network_helpers.h"
#include "task_local_storage_helpers.h"
static const char * const bash_envp[] = { "TMPDIR=shouldnotbeset", NULL };
static int ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt_unix' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright Amazon.com Inc. or its affiliates. */
#include <sys/socket.h>
#include <sys/un.h>
#include <test_progs.h>
#include "bpf_iter_setsockopt_unix.skel.h"
#define NR_CASES 5
static int create_unix_socket(struct bpf_iter_setsockopt_unix *skel)
{
struct sockaddr_un addr ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_skb_pkt_end' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */
#include <test_progs.h>
#include <network_helpers.h>
#include "skb_pkt_end.skel.h"
static int sanity_run(struct bpf_program *prog)
{
int err, prog_fd;
LIBBPF_OPTS(bpf_test_run_opts, topts,
.data_in = &pkt_v4,
.data_size_in = sizeof(pkt_v4... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/*
* Tests for attaching, detaching, and replacing flow_dissector BPF program.
*/
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/bpf.h>
#include <bpf/bpf.h>
#include... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/lwt_misc' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "lwt_misc.skel.h"
void test_lwt_misc(void)
{
RUN_TESTS(lwt_misc);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/for_each' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <test_progs.h>
#include <network_helpers.h>
#include "for_each_hash_map_elem.skel.h"
#include "for_each_array_map_elem.skel.h"
#include "for_each_map_elem_write_key.skel.h"
#include "for_each_multi_maps.skel.h"
#include "for_each_hash_m... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/send_signal' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "test_send_signal_kern.skel.h"
#include "io_helpers.h"
static int sigusr1_received;
static void sigusr1_handler(int signum)
{
sigusr1_received = 8;
}
static void sigusr1_siginfo_handler(int s, s... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/subskeleton' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "test_subskeleton.skel.h"
#include "test_subskeleton_lib.subskel.h"
static void subskeleton_lib_setup(struct bpf_object *obj)
{
struct test_subskeleton_lib *lib = test_subskeleton_lib__o... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/btf_distill' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024, Oracle and/or its affiliates. */
#include <test_progs.h>
#include <bpf/btf.h>
#include "btf_helpers.h"
/* Fabricate base, split BTF with references to base types needed; then create
* split BTF with distilled base BTF and ensure expectations are met:
*... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/verifier' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0-only
#include <test_progs.h>
#include "cap_helpers.h"
#include "verifier_align.skel.h"
#include "verifier_and.skel.h"
#include "verifier_arena.skel.h"
#include "verifier_arena_large.skel.h"
#include "verifier_arena_globals1.skel.h"
#include "verifier_arena_globals2.skel.h"
#in... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/dmabuf_iter' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Google */
#include <test_progs.h>
#include <bpf/libbpf.h>
#include <bpf/btf.h>
#include "dmabuf_iter.skel.h"
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#i... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/skeleton' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 Facebook */
#include <test_progs.h>
#include <sys/mman.h>
struct s {
int a;
long long b;
} __attribute__((packed));
#include "test_skeleton.skel.h"
void test_skeleton(void)
{
int duration = 0, err;
struct test_skeleton* skel;
struct test_skeleton__... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/udp_limit' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "udp_limit.skel.h"
#include <sys/types.h>
#include <sys/socket.h>
void test_udp_limit(void)
{
struct udp_limit *skel;
int fd1 = -1, fd2 = -1;
int cgroup_fd;
cgroup_fd = test__join_cgroup("/udp_limit");
if (!ASSERT_GE(cgroup_fd, 0, "cg-joi... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/reference_tracking' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
void test_reference_tracking(void)
{
const char *file = "test_sk_lookup_kern.bpf.o";
const char *obj_name = "ref_track";
DECLARE_LIBBPF_OPTS(bpf_object_open_opts, open_opts,
.object_name = obj_name,
.relaxed_maps = true,
);
struct bpf_object *ob... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/vrf_socket_lookup' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Topology:
* ---------
* NS0 namespace | NS1 namespace
* |
* +--------------+ | +--------------+
* | veth01 |----------| veth10 |
* | 172.16.1.100 | | | 172.16.1.200 |
* | bpf | ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/log_fixup' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include <bpf/btf.h>
#include "test_log_fixup.skel.h"
enum trunc_type {
TRUNC_NONE,
TRUNC_PARTIAL,
TRUNC_FULL,
};
static void bad_core_relo(size_t log_buf_size, enum trunc_type trunc_type... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/stacktrace_map_raw_tp' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
void test_stacktrace_map_raw_tp(void)
{
const char *prog_name = "oncpu";
int control_map_fd, stackid_hmap_fd, stackmap_fd;
const char *file = "./stacktrace_map.bpf.o";
__u32 key, val, duration = 0;
int err, prog_fd;
struct bpf_program *prog;
struc... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/global_func_dead_code' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "verifier_global_subprogs.skel.h"
#include "freplace_dead_global_func.skel.h"
void test_global_func_dead_code(void)
{
struct verifier_global_subprogs *tgt_skel = NULL;
struct frepl... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/core_kern_overflow' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include "test_progs.h"
#include "core_kern_overflow.lskel.h"
void test_core_kern_overflow_lskel(void)
{
struct core_kern_overflow_lskel *skel;
skel = core_kern_overflow_lskel__open_and_load();
if (!ASSERT_NULL(skel, "open_and_load"))
core_kern_overflow_lskel__destroy(sk... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/net_timestamping' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
#include <linux/net_tstamp.h>
#include <sys/time.h>
#include <linux/errqueue.h>
#include "test_progs.h"
#include "network_helpers.h"
#include "net_timestamping.skel.h"
#define CG_NAME "/net-timestamping-test"
#define NSEC_PER_SEC 1000000000LL
static const char addr4_str[] = "127.0.0.1";
static const char addr... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/iter_buf_null_fail' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "iter_buf_null_fail.skel.h"
void test_iter_buf_null_fail(void)
{
RUN_TESTS(iter_buf_null_fail);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/spin_lock' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <regex.h>
#include <test_progs.h>
#include <network_helpers.h>
#include "test_spin_lock.skel.h"
#include "test_spin_lock_fail.skel.h"
static char log_buf[1024 * 1024];
static struct {
const char *prog_name;
const char *err_msg;
} spin_lock_fail_tests[] = {
{ "lock... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/stream' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include <sys/mman.h>
#include "stream.skel.h"
#include "stream_fail.skel.h"
void test_stream_failure(void)
{
RUN_TESTS(stream_fail);
}
void test_stream_success(void)
{
RUN_TESTS(stream);
... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/test_struct_ops_maybe_null' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
#include <test_progs.h>
#include "struct_ops_maybe_null.skel.h"
#include "struct_ops_maybe_null_fail.skel.h"
/* Test that the verifier accepts a program that access a nullable pointer
* with a proper check.
*/
sta... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/sk_assign' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018 Facebook
// Copyright (c) 2019 Cloudflare
// Copyright (c) 2020 Isovalent, Inc.
/*
* Test that the socket assign program is able to redirect traffic towards a
* socket, regardless of whether the port or address destination of the traffic
* matches the po... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/btf_module' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2021 Hengqi Chen */
#include <test_progs.h>
#include <bpf/btf.h>
static const char *module_name = "bpf_testmod";
static const char *symbol_name = "bpf_testmod_test_read";
void test_btf_module()
{
struct btf *vmlinux_btf, *module_btf;
__s32 type_id;
if ... | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/tp_btf_nullable' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "test_tp_btf_nullable.skel.h"
void test_tp_btf_nullable(void)
{
if (!env.has_testmod) {
test__skip();
return;
}
RUN_TESTS(test_tp_btf_nullable);
}
``` | |
Linux kernel'inin 'tools/testing/selftests/bpf/prog_tests/stacktrace_map_skip' alt sistemi için gerekli C kaynak kodunu implemente et. | ```c
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "stacktrace_map_skip.skel.h"
#define TEST_STACK_DEPTH 2
void test_stacktrace_map_skip(void)
{
struct stacktrace_map_skip *skel;
int stackid_hmap_fd, stackmap_fd, stack_amap_fd;
int err, stack_trace_len;
skel = stacktrace_map_skip__open_an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.