int pick_online_cpu(void); int bind_to_cpu(int cpu);
int parse_intmax(constchar *buffer, size_t count, intmax_t *result, int base); int parse_uintmax(constchar *buffer, size_t count, uintmax_t *result, int base); int parse_int(constchar *buffer, size_t count, int *result, int base); int parse_uint(constchar *buffer, size_t count, unsignedint *result, int base); int parse_long(constchar *buffer, size_t count, long *result, int base); int parse_ulong(constchar *buffer, size_t count, unsignedlong *result, int base);
int read_file(constchar *path, char *buf, size_t count, size_t *len); int write_file(constchar *path, constchar *buf, size_t count); int read_file_alloc(constchar *path, char **buf, size_t *len); int read_long(constchar *path, long *result, int base); int write_long(constchar *path, long result, int base); int read_ulong(constchar *path, unsignedlong *result, int base); int write_ulong(constchar *path, unsignedlong result, int base); int read_debugfs_file(constchar *debugfs_file, char *buf, size_t count); int write_debugfs_file(constchar *debugfs_file, constchar *buf, size_t count); int read_debugfs_int(constchar *debugfs_file, int *result); int write_debugfs_int(constchar *debugfs_file, int result); int read_sysfs_file(char *debugfs_file, char *result, size_t result_size); int perf_event_open_counter(unsignedint type, unsignedlong config, int group_fd); int perf_event_enable(int fd); int perf_event_disable(int fd); int perf_event_reset(int fd);
/* Yes, this is evil */ #define FAIL_IF(x) \ do { \ if ((x)) { \
fprintf(stderr, \ "[FAIL] Test FAILED on line %d\n", __LINE__); \ return 1; \
} \
} while (0)
#define FAIL_IF_MSG(x, msg) \ do { \ if ((x)) { \
fprintf(stderr, \ "[FAIL] Test FAILED on line %d: %s\n", \
__LINE__, msg); \ return 1; \
} \
} while (0)
#define FAIL_IF_EXIT(x) \ do { \ if ((x)) { \
fprintf(stderr, \ "[FAIL] Test FAILED on line %d\n", __LINE__); \
_exit(1); \
} \
} while (0)
#define FAIL_IF_EXIT_MSG(x, msg) \ do { \ if ((x)) { \
fprintf(stderr, \ "[FAIL] Test FAILED on line %d: %s\n", \
__LINE__, msg); \
_exit(1); \
} \
} while (0)
/* The test harness uses this, yes it's gross */ #define MAGIC_SKIP_RETURN_VALUE 99
#define SKIP_IF(x) \ do { \ if ((x)) { \
fprintf(stderr, \ "[SKIP] Test skipped on line %d\n", __LINE__); \ return MAGIC_SKIP_RETURN_VALUE; \
} \
} while (0)
#define SKIP_IF_MSG(x, msg) \ do { \ if ((x)) { \
fprintf(stderr, \ "[SKIP] Test skipped on line %d: %s\n", \
__LINE__, msg); \ return MAGIC_SKIP_RETURN_VALUE; \
} \
} while (0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.