tools/tracing/rtla/src/utils.h
Source file repositories/reference/linux-study-clean/tools/tracing/rtla/src/utils.h
File Facts
- System
- Linux kernel
- Corpus path
tools/tracing/rtla/src/utils.h- Extension
.h- Size
- 3605 bytes
- Lines
- 126
- 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
stdint.hstring.htime.hsched.hstdbool.hstdlib.hlinux/container_of.h
Detected Declarations
struct sched_attrenum stack_formatenum resultfunction str_has_prefixfunction update_minfunction update_maxfunction update_sumfunction have_libcpupower_supportfunction save_cpu_idle_disable_statefunction restore_cpu_idle_disable_statefunction free_cpu_idle_disable_statesfunction have_libcpupower_support
Annotated Snippet
struct sched_attr {
uint32_t size;
uint32_t sched_policy;
uint64_t sched_flags;
int32_t sched_nice;
uint32_t sched_priority;
uint64_t sched_runtime;
uint64_t sched_deadline;
uint64_t sched_period;
};
#endif /* SCHED_ATTR_SIZE_VER0 */
enum stack_format {
STACK_FORMAT_TRUNCATE,
STACK_FORMAT_SKIP,
STACK_FORMAT_FULL
};
int parse_prio(char *arg, struct sched_attr *sched_param);
int parse_cpu_set(char *cpu_list, cpu_set_t *set);
int parse_stack_format(char *arg);
int __set_sched_attr(int pid, struct sched_attr *attr);
int set_comm_sched_attr(const char *comm_prefix, struct sched_attr *attr);
int set_comm_cgroup(const char *comm_prefix, const char *cgroup);
int set_pid_cgroup(pid_t pid, const char *cgroup);
int set_cpu_dma_latency(int32_t latency);
void *calloc_fatal(size_t n, size_t size);
void *reallocarray_fatal(void *p, size_t n, size_t size);
char *strdup_fatal(const char *s);
#ifdef HAVE_LIBCPUPOWER_SUPPORT
int save_cpu_idle_disable_state(unsigned int cpu);
int restore_cpu_idle_disable_state(unsigned int cpu);
void free_cpu_idle_disable_states(void);
int set_deepest_cpu_idle_state(unsigned int cpu, unsigned int state);
static inline int have_libcpupower_support(void) { return 1; }
#else
static inline int save_cpu_idle_disable_state(unsigned int cpu) { return -1; }
static inline int restore_cpu_idle_disable_state(unsigned int cpu) { return -1; }
static inline void free_cpu_idle_disable_states(void) { }
static inline int set_deepest_cpu_idle_state(unsigned int cpu, unsigned int state) { return -1; }
static inline int have_libcpupower_support(void) { return 0; }
#endif /* HAVE_LIBCPUPOWER_SUPPORT */
int auto_house_keeping(cpu_set_t *monitored_cpus);
__attribute__((__warn_unused_result__)) int strtoi(const char *s, int *res);
#define ns_to_usf(x) (((double)x/1000))
#define ns_to_per(total, part) ((part * 100) / (double)total)
enum result {
PASSED = EXIT_SUCCESS,
ERROR = EXIT_FAILURE,
FAILED, /* test hit the stop tracing condition */
};
Annotation
- Immediate include surface: `stdint.h`, `string.h`, `time.h`, `sched.h`, `stdbool.h`, `stdlib.h`, `linux/container_of.h`.
- Detected declarations: `struct sched_attr`, `enum stack_format`, `enum result`, `function str_has_prefix`, `function update_min`, `function update_max`, `function update_sum`, `function have_libcpupower_support`, `function save_cpu_idle_disable_state`, `function restore_cpu_idle_disable_state`.
- 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.