tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
Source file repositories/reference/linux-study-clean/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c- Extension
.c- Size
- 18665 bytes
- Lines
- 581
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: syscall or user/kernel boundary
- Status
- core 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 participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.hbpf/bpf_helpers.hlinux/limits.h
Detected Declarations
struct __augmented_syscalls__struct syscalls_sys_enterstruct syscalls_sys_exitstruct syscall_enter_argsstruct syscall_exit_argsstruct sockaddr_storagestruct augmented_argstruct pids_filteredstruct augmented_args_payloadstruct augmented_args_tmpstruct beauty_map_enterstruct beauty_payload_enterstruct beauty_payload_enter_mapstruct perf_event_attr_sizefunction augmented__outputfunction augmented__beauty_outputfunction augmented_arg__read_strfunction syscall_unaugmentedfunction SECfunction sys_enter_sendtofunction sys_enter_openfunction sys_enter_openatfunction sys_enter_renamefunction sys_enter_renameat2function sys_enter_perf_event_openfunction sys_enter_clock_nanosleepfunction sys_enter_nanosleepfunction getpidfunction pid_filter__hasfunction augment_sys_enterfunction sys_enterfunction sys_exit
Annotated Snippet
struct __augmented_syscalls__ {
__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
__type(key, int);
__type(value, __u32);
__uint(max_entries, MAX_CPUS);
} __augmented_syscalls__ SEC(".maps");
/*
* What to augment at entry?
*
* Pointer arg payloads (filenames, etc) passed from userspace to the kernel
*/
struct syscalls_sys_enter {
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
__type(key, __u32);
__type(value, __u32);
__uint(max_entries, 1024);
} syscalls_sys_enter SEC(".maps");
/*
* What to augment at exit?
*
* Pointer arg payloads returned from the kernel (struct stat, etc) to userspace.
*/
struct syscalls_sys_exit {
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
__type(key, __u32);
__type(value, __u32);
__uint(max_entries, 1024);
} syscalls_sys_exit SEC(".maps");
struct syscall_enter_args {
unsigned long long common_tp_fields;
long syscall_nr;
unsigned long args[6];
};
struct syscall_exit_args {
unsigned long long common_tp_fields;
long syscall_nr;
long ret;
};
/*
* Desired design of maximum size and alignment (see RFC2553)
*/
#define SS_MAXSIZE 128 /* Implementation specific max size */
typedef unsigned short sa_family_t;
/*
* FIXME: Should come from system headers
*
* The definition uses anonymous union and struct in order to control the
* default alignment.
*/
struct sockaddr_storage {
union {
struct {
sa_family_t ss_family; /* address family */
/* Following field(s) are implementation specific */
char __data[SS_MAXSIZE - sizeof(unsigned short)];
/* space to achieve desired size, */
/* _SS_MAXSIZE value minus size of ss_family */
};
void *__align; /* implementation specific desired alignment */
};
};
struct augmented_arg {
unsigned int size;
int err;
union {
char value[PATH_MAX];
struct sockaddr_storage saddr;
};
};
struct pids_filtered {
__uint(type, BPF_MAP_TYPE_HASH);
__type(key, pid_t);
__type(value, bool);
__uint(max_entries, 64);
} pids_filtered SEC(".maps");
struct augmented_args_payload {
struct syscall_enter_args args;
struct augmented_arg arg, arg2; // We have to reserve space for two arguments (rename, etc)
};
Annotation
- Immediate include surface: `vmlinux.h`, `bpf/bpf_helpers.h`, `linux/limits.h`.
- Detected declarations: `struct __augmented_syscalls__`, `struct syscalls_sys_enter`, `struct syscalls_sys_exit`, `struct syscall_enter_args`, `struct syscall_exit_args`, `struct sockaddr_storage`, `struct augmented_arg`, `struct pids_filtered`, `struct augmented_args_payload`, `struct augmented_args_tmp`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: core 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.