rusage: Fix initialization of rusage->num_processors
Refs: #1064 Change-Id: I4c04127a766b9c71f726113b8b7d6416ff971bff
This commit is contained in:
committed by
Dominique Martinet
parent
8ff754c466
commit
a6ac4acf40
44
test/rusage/util.h
Normal file
44
test/rusage/util.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef __UTIL_H_INCLUDED__
|
||||
#define __UTIL_H_INCLUDED__
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#define dprintf(...) do { \
|
||||
char msg[1024]; \
|
||||
sprintf(msg, __VA_ARGS__); \
|
||||
fprintf(stderr, "%s,%s", __func__, msg); \
|
||||
} while (0)
|
||||
#else
|
||||
#define dprintf(...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define eprintf(...) do { \
|
||||
char msg[1024]; \
|
||||
sprintf(msg, __VA_ARGS__); \
|
||||
fprintf(stderr, "%s,%s", __func__, msg); \
|
||||
} while (0)
|
||||
|
||||
#define CHKANDJUMP(cond, err, ...) do { \
|
||||
if (cond) { \
|
||||
eprintf(__VA_ARGS__); \
|
||||
ret = err; \
|
||||
goto fn_fail; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define OKNG(cond, ...) do { \
|
||||
if (cond) { \
|
||||
printf("[ OK ] "); \
|
||||
printf(__VA_ARGS__); \
|
||||
} else { \
|
||||
printf("[ NG ] "); \
|
||||
printf(__VA_ARGS__); \
|
||||
ret = -EINVAL; \
|
||||
goto out; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user