tools/testing/selftests/bpf/progs/test_autoattach.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/test_autoattach.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/test_autoattach.c
Extension
.c
Size
352 bytes
Lines
24
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

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022 Google */

#include "vmlinux.h"
#include <bpf/bpf_tracing.h>

bool prog1_called = false;
bool prog2_called = false;

SEC("raw_tp/sys_enter")
int prog1(const void *ctx)
{
	prog1_called = true;
	return 0;
}

SEC("raw_tp/sys_exit")
int prog2(const void *ctx)
{
	prog2_called = true;
	return 0;
}

Annotation

Implementation Notes