tools/objtool/include/objtool/warn.h
Source file repositories/reference/linux-study-clean/tools/objtool/include/objtool/warn.h
File Facts
- System
- Linux kernel
- Corpus path
tools/objtool/include/objtool/warn.h- Extension
.h- Size
- 5000 bytes
- Lines
- 169
- 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
stdlib.hstring.hsys/types.hsys/stat.hfcntl.herrno.hobjtool/builtin.hobjtool/elf.h
Detected Declarations
function unindentfunction __cleanup
Annotated Snippet
static inline void unindent(int *unused) { indent--; }
/*
* Clang prior to 17 is being silly and considers many __cleanup() variables
* as unused (because they are, their sole purpose is to go out of scope).
*
* https://github.com/llvm/llvm-project/commit/877210faa447f4cc7db87812f8ed80e398fedd61
*/
#undef __cleanup
#define __cleanup(func) __maybe_unused __attribute__((__cleanup__(func)))
#define __dbg(format, ...) \
fprintf(stderr, \
"DEBUG: %s%s" format "\n", \
objname ?: "", \
objname ? ": " : "", \
##__VA_ARGS__)
#define dbg_checksum_insn(func, insn, checksum) \
({ \
if (unlikely(func->debug_checksum)) { \
char *insn_off = offstr(insn->sec, insn->offset); \
__dbg("checksum: %s(): %s %016llx", \
func->name, insn_off, (unsigned long long)checksum);\
free(insn_off); \
} \
})
#define dbg_checksum_object(sym, offset, what, checksum) \
({ \
if (unlikely(sym->debug_checksum)) \
__dbg("checksum: %s+0x%lx: %s %016llx", \
sym->name, offset, what, \
(unsigned long long)checksum); \
})
#define dbg_correlate(args...) \
({ \
if (unlikely(debug_correlate)) \
__dbg(args); \
})
#define __dbg_clone(format, ...) \
({ \
if (unlikely(debug_clone)) \
__dbg("%*s" format, indent * 8, "", ##__VA_ARGS__); \
})
#define dbg_clone(args...) \
int __cleanup(unindent) __dummy_##__COUNTER__; \
__dbg_clone(args); \
indent++
#endif /* _WARN_H */
Annotation
- Immediate include surface: `stdlib.h`, `string.h`, `sys/types.h`, `sys/stat.h`, `fcntl.h`, `errno.h`, `objtool/builtin.h`, `objtool/elf.h`.
- Detected declarations: `function unindent`, `function __cleanup`.
- 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.