29static inline uint64_t get_timestamp(
void) {
31 clock_gettime(CLOCK_MONOTONIC_RAW, &t);
32 return (uint64_t)t.tv_sec * 1000000000LL + (uint64_t)t.tv_nsec;
36static inline int plugin_is_verbose() {
37 static int initialized = 0;
41 const char *env = getenv(
"DLB_PLUGIN_VERBOSE");
42 if (env && (*env ==
'1' || *env ==
'y' || *env ==
'Y')) {
50#define PLUGIN_PRINT(fmt, ...) \
51 do { if (plugin_is_verbose()) fprintf(stderr, "[DLB PLUGIN] " fmt, ##__VA_ARGS__); } while (0)
53#define PLUGIN_ERROR(fmt, ...) \
54 do { fprintf(stderr, "[DLB PLUGIN ERROR] " fmt, ##__VA_ARGS__); } while (0)
56#define PLUGIN_WARNING(fmt, ...) \
57 do { fprintf(stderr, "[DLB PLUGIN WARNING] " fmt, ##__VA_ARGS__); } while (0)
#define verbose(flag,...)
Definition: debug.h:73