include/trace/events/capability.h
Source file repositories/reference/linux-study-clean/include/trace/events/capability.h
File Facts
- System
- Linux kernel
- Corpus path
include/trace/events/capability.h- Extension
.h- Size
- 1712 bytes
- Lines
- 58
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cred.hlinux/tracepoint.hlinux/user_namespace.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#undef TRACE_SYSTEM
#define TRACE_SYSTEM capability
#if !defined(_TRACE_CAPABILITY_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_CAPABILITY_H
#include <linux/cred.h>
#include <linux/tracepoint.h>
#include <linux/user_namespace.h>
/**
* cap_capable - called after it's determined if a task has a particular
* effective capability
*
* @cred: The credentials used
* @target_ns: The user namespace of the resource being accessed
* @capable_ns: The user namespace in which the credential provides the
* capability to access the targeted resource.
* This will be NULL if ret is not 0.
* @cap: The capability to check for
* @ret: The return value of the check: 0 if it does, -ve if it does not
*
* Allows to trace calls to cap_capable in commoncap.c
*/
TRACE_EVENT(cap_capable,
TP_PROTO(const struct cred *cred, struct user_namespace *target_ns,
const struct user_namespace *capable_ns, int cap, int ret),
TP_ARGS(cred, target_ns, capable_ns, cap, ret),
TP_STRUCT__entry(
__field(const struct cred *, cred)
__field(struct user_namespace *, target_ns)
__field(const struct user_namespace *, capable_ns)
__field(int, cap)
__field(int, ret)
),
TP_fast_assign(
__entry->cred = cred;
__entry->target_ns = target_ns;
__entry->capable_ns = ret == 0 ? capable_ns : NULL;
__entry->cap = cap;
__entry->ret = ret;
),
TP_printk("cred %p, target_ns %p, capable_ns %p, cap %d, ret %d",
__entry->cred, __entry->target_ns, __entry->capable_ns, __entry->cap,
__entry->ret)
);
#endif /* _TRACE_CAPABILITY_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
Annotation
- Immediate include surface: `linux/cred.h`, `linux/tracepoint.h`, `linux/user_namespace.h`, `trace/define_trace.h`.
- Atlas domain: Repository Root And Misc / include.
- 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.