tools/perf/util/util.h
Source file repositories/reference/linux-study-clean/tools/perf/util/util.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/util.h- Extension
.h- Size
- 3016 bytes
- Lines
- 127
- 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
dirent.hfcntl.hstdbool.hstddef.hlinux/compiler.hlinux/bitmap.hsys/types.hinternal/cpumap.h
Detected Declarations
struct direntstruct strliststruct perf_debuginfodfunction host_is_bigendian
Annotated Snippet
struct perf_debuginfod {
const char *urls;
bool set;
};
void perf_debuginfod_setup(struct perf_debuginfod *di);
const char *perf_basename(const char *path);
char *filename_with_chroot(int pid, const char *filename);
int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,
size_t msz, const void *init_val);
#define realloc_array_as_needed(a, n, x, v) ({ \
typeof(x) __x = (x); \
__x >= (n) ? \
do_realloc_array_as_needed((void **)&(a), \
&(n), \
__x, \
sizeof(*(a)), \
(const void *)(v)) : \
0; \
})
static inline bool host_is_bigendian(void)
{
#ifdef __BYTE_ORDER__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return false;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
return true;
#else
#error "Unrecognized __BYTE_ORDER__"
#endif
#else /* !__BYTE_ORDER__ */
unsigned char str[] = { 0x1, 0x2, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0};
unsigned int *ptr;
ptr = (unsigned int *)(void *)str;
return *ptr == 0x01020304;
#endif
}
#endif /* __PERF_UTIL_H */
Annotation
- Immediate include surface: `dirent.h`, `fcntl.h`, `stdbool.h`, `stddef.h`, `linux/compiler.h`, `linux/bitmap.h`, `sys/types.h`, `internal/cpumap.h`.
- Detected declarations: `struct dirent`, `struct strlist`, `struct perf_debuginfod`, `function host_is_bigendian`.
- 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.