#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <linux/compiler.h>
#include <sys/types.h>
Go to the source code of this file.
|
void | usage (const char *err) __noreturn |
|
void | die (const char *err,...) __noreturn __printf(1 |
|
void static void * | zalloc (size_t size) |
|
int | mkdir_p (char *path, mode_t mode) |
|
int | rm_rf (const char *path) |
|
struct strlist * | lsdir (const char *name, bool(*filter)(const char *, struct dirent *)) |
|
bool | lsdir_no_dot_filter (const char *name, struct dirent *d) |
|
int | copyfile (const char *from, const char *to) |
|
int | copyfile_mode (const char *from, const char *to, mode_t mode) |
|
int | copyfile_ns (const char *from, const char *to, struct nsinfo *nsi) |
|
ssize_t | readn (int fd, void *buf, size_t n) |
|
ssize_t | writen (int fd, const void *buf, size_t n) |
|
size_t | hex_width (u64 v) |
|
int | hex2u64 (const char *ptr, u64 *val) |
|
int __pure | cacheline_size (void) |
|
int | sysctl__max_stack (void) |
|
int | fetch_kernel_version (unsigned int *puint, char *str, size_t str_sz) |
|
const char * | perf_tip (const char *dirpath) |
|
int | sched_getcpu (void) |
|
int | setns (int fd, int nstype) |
|
void | perf_set_singlethreaded (void) |
|
void | perf_set_multithreaded (void) |
|
◆ _BSD_SOURCE
Definition at line 5 of file util.h.
◆ _DEFAULT_SOURCE
#define _DEFAULT_SOURCE 1 |
Definition at line 7 of file util.h.
◆ KVER_FMT
#define KVER_FMT "%d.%d.%d" |
◆ KVER_PARAM
◆ KVER_PATCHLEVEL
#define KVER_PATCHLEVEL |
( |
|
x | ) |
(((x) >> 8) & 0xff) |
◆ KVER_SUBLEVEL
#define KVER_SUBLEVEL |
( |
|
x | ) |
((x) & 0xff) |
◆ KVER_VERSION
#define KVER_VERSION |
( |
|
x | ) |
(((x) >> 16) & 0xff) |
◆ O_CLOEXEC
#define O_CLOEXEC 02000000 |
◆ zfree
#define zfree |
( |
|
ptr | ) |
({ free(*ptr); *ptr = NULL; }) |
◆ cacheline_size()
int __pure cacheline_size |
( |
void |
| ) |
|
◆ copyfile()
int copyfile |
( |
const char * |
from, |
|
|
const char * |
to |
|
) |
| |
◆ copyfile_mode()
int copyfile_mode |
( |
const char * |
from, |
|
|
const char * |
to, |
|
|
mode_t |
mode |
|
) |
| |
◆ copyfile_ns()
int copyfile_ns |
( |
const char * |
from, |
|
|
const char * |
to, |
|
|
struct nsinfo * |
nsi |
|
) |
| |
◆ die()
void die |
( |
const char * |
err, |
|
|
|
... |
|
) |
| |
◆ fetch_kernel_version()
int fetch_kernel_version |
( |
unsigned int * |
puint, |
|
|
char * |
str, |
|
|
size_t |
str_sz |
|
) |
| |
◆ hex2u64()
int hex2u64 |
( |
const char * |
ptr, |
|
|
u64 * |
val |
|
) |
| |
◆ hex_width()
size_t hex_width |
( |
u64 |
v | ) |
|
◆ lsdir()
struct strlist* lsdir |
( |
const char * |
name, |
|
|
bool(*)(const char *, struct dirent *) |
filter |
|
) |
| |
◆ lsdir_no_dot_filter()
bool lsdir_no_dot_filter |
( |
const char * |
name, |
|
|
struct dirent * |
d |
|
) |
| |
◆ mkdir_p()
int mkdir_p |
( |
char * |
path, |
|
|
mode_t |
mode |
|
) |
| |
◆ perf_set_multithreaded()
void perf_set_multithreaded |
( |
void |
| ) |
|
◆ perf_set_singlethreaded()
void perf_set_singlethreaded |
( |
void |
| ) |
|
◆ perf_tip()
const char* perf_tip |
( |
const char * |
dirpath | ) |
|
◆ readn()
ssize_t readn |
( |
int |
fd, |
|
|
void * |
buf, |
|
|
size_t |
n |
|
) |
| |
◆ rm_rf()
int rm_rf |
( |
const char * |
path | ) |
|
◆ sched_getcpu()
int sched_getcpu |
( |
void |
| ) |
|
◆ setns()
int setns |
( |
int |
fd, |
|
|
int |
nstype |
|
) |
| |
◆ sysctl__max_stack()
int sysctl__max_stack |
( |
void |
| ) |
|
◆ usage()
void usage |
( |
const char * |
err | ) |
|
◆ writen()
ssize_t writen |
( |
int |
fd, |
|
|
const void * |
buf, |
|
|
size_t |
n |
|
) |
| |
◆ zalloc()
void static void* zalloc |
( |
size_t |
size | ) |
|
|
inlinestatic |
◆ page_size
◆ perf_singlethreaded