tools/testing/selftests/bpf/test_kmods/bpf_testmod-events.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/test_kmods/bpf_testmod-events.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/test_kmods/bpf_testmod-events.h- Extension
.h- Size
- 2141 bytes
- Lines
- 82
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tracepoint.hbpf_testmod.htrace/define_trace.h
Detected Declarations
struct sk_buff
Annotated Snippet
#undef TRACE_SYSTEM
#define TRACE_SYSTEM bpf_testmod
#if !defined(_BPF_TESTMOD_EVENTS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _BPF_TESTMOD_EVENTS_H
#include <linux/tracepoint.h>
#include "bpf_testmod.h"
TRACE_EVENT(bpf_testmod_test_read,
TP_PROTO(struct task_struct *task, struct bpf_testmod_test_read_ctx *ctx),
TP_ARGS(task, ctx),
TP_STRUCT__entry(
__field(pid_t, pid)
__array(char, comm, TASK_COMM_LEN)
__field(loff_t, off)
__field(size_t, len)
),
TP_fast_assign(
__entry->pid = task->pid;
memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
__entry->off = ctx->off;
__entry->len = ctx->len;
),
TP_printk("pid=%d comm=%s off=%llu len=%zu",
__entry->pid, __entry->comm, __entry->off, __entry->len)
);
/* A bare tracepoint with no event associated with it */
DECLARE_TRACE(bpf_testmod_test_write_bare,
TP_PROTO(struct task_struct *task, struct bpf_testmod_test_write_ctx *ctx),
TP_ARGS(task, ctx)
);
/* Used in bpf_testmod_test_read() to test __nullable suffix */
DECLARE_TRACE(bpf_testmod_test_nullable_bare,
TP_PROTO(struct bpf_testmod_test_read_ctx *ctx__nullable),
TP_ARGS(ctx__nullable)
);
struct sk_buff;
DECLARE_TRACE(bpf_testmod_test_raw_tp_null,
TP_PROTO(struct sk_buff *skb),
TP_ARGS(skb)
);
#undef BPF_TESTMOD_DECLARE_TRACE
#ifdef DECLARE_TRACE_WRITABLE
#define BPF_TESTMOD_DECLARE_TRACE(call, proto, args, size) \
DECLARE_TRACE_WRITABLE(call, PARAMS(proto), PARAMS(args), size)
#else
#define BPF_TESTMOD_DECLARE_TRACE(call, proto, args, size) \
DECLARE_TRACE(call, PARAMS(proto), PARAMS(args))
#endif
BPF_TESTMOD_DECLARE_TRACE(bpf_testmod_test_writable_bare,
TP_PROTO(struct bpf_testmod_test_writable_ctx *ctx),
TP_ARGS(ctx),
sizeof(struct bpf_testmod_test_writable_ctx)
);
DECLARE_TRACE(bpf_testmod_fentry_test1,
TP_PROTO(int a),
TP_ARGS(a)
);
DECLARE_TRACE(bpf_testmod_fentry_test2,
TP_PROTO(int a, u64 b),
TP_ARGS(a, b)
);
#endif /* _BPF_TESTMOD_EVENTS_H */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE bpf_testmod-events
#include <trace/define_trace.h>
Annotation
- Immediate include surface: `linux/tracepoint.h`, `bpf_testmod.h`, `trace/define_trace.h`.
- Detected declarations: `struct sk_buff`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.