-
Notifications
You must be signed in to change notification settings - Fork 21
/
common.h
57 lines (43 loc) · 1.14 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright (c) 2017, Linaro Limited
* SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef COMMON_H
#define COMMON_H
/*
* Misc. output defines
*/
#define OUTPUT_APP_PREFIX "Benchmark"
#ifdef DEBUG
#define DBG(fmt, args...) printf("[" OUTPUT_APP_PREFIX \
"] DEBUG: %s:%d:%s(): " fmt "\n", __FILE__, __LINE__, __func__, ##args)
#else
#define DBG(fmt, args...)
#endif
#define INFO(fmt, args...) printf("[" OUTPUT_APP_PREFIX \
"] INFO: " fmt "\n", ##args)
#define ERROR(fmt, args...) fprintf(stderr, "[" OUTPUT_APP_PREFIX \
"] ERROR: " fmt "\n", ##args)
#define ERROR_EXIT(fmt, args...) do { \
ERROR(fmt, ##args); \
exit(EXIT_FAILURE); \
} while(0)
#define ERROR_RETURN_FALSE(fmt, args...) do { \
ERROR(fmt, ##args); \
return false; \
} while(0)
#define ERROR_GOTO(label, fmt, args...) do { \
ERROR(fmt, ##args); \
goto label; \
} while(0)
#define STAT_AMOUNT 5
#define TSFILE_NAME_SUFFIX ".ts"
#define YAML_IMPLICIT 1
/*
* Ringbuffer return codes
*/
#define RING_SUCCESS 0
#define RING_BADPARM -1
#define RING_NODATA -2
#define LIBTEEC_NAME "libteec.so"
#endif /* COMMON.H */