tools/testing/selftests/bpf/progs/bpf_test_utils.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/bpf_test_utils.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/bpf_test_utils.h
Extension
.h
Size
398 bytes
Lines
19
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __BPF_TEST_UTILS_H__
#define __BPF_TEST_UTILS_H__

#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"

/* Clobber as many native registers and stack slots as possible. */
static __always_inline void clobber_regs_stack(void)
{
	char tmp_str[] = "123456789";
	unsigned long tmp;

	bpf_strtoul(tmp_str, sizeof(tmp_str), 0, &tmp);
	__sink(tmp);
}

#endif

Annotation

Implementation Notes