}
#ifdef DEBUG
+#include <time.h>
+
#define dprintf(fmt, arg...) \
- fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
+ do { \
+ struct timespec ts; \
+ clock_gettime(CLOCK_MONOTONIC, &ts); \
+ double timestamp = ts.tv_sec + ts.tv_nsec / 1e9; \
+ fprintf(stderr, "[%10.5f] %s: %s: " fmt, timestamp, Name, __func__, ##arg); \
+ } while (0)
+
#define dprintf_cont(fmt, arg...) \
fprintf(stderr, fmt, ##arg)
#else
#define dprintf(fmt, arg...) \
- ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
+ do { } while (0)
#define dprintf_cont(fmt, arg...) \
- ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+ do { } while (0)
#endif
static inline int xasprintf(char **strp, const char *fmt, ...) {
struct mdinfo *mdi;
int ret = 0;
int count = 0;
- struct timeval tv;
bool write_checkpoint = false;
a->next_state = bad_word;
check_for_cleared_bb(a, mdi);
}
- gettimeofday(&tv, NULL);
- dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+ dprintf("(%d): state:%s prev:%s action:%s prev: %s start:%llu\n",
a->info.container_member,
- tv.tv_sec, tv.tv_usec,
array_states[a->curr_state],
array_states[a->prev_state],
sync_actions[a->curr_action],
for (i = 0; i < tbl_size; i++) {
struct imsm_disk *d;
struct intel_disk *idisk;
- struct imsm_super *mpb = super_table[i]->anchor;
s = super_table[i];
d = &s->disks->disk;
if (!s)
dprintf("marking family: %#x from %d:%d offline\n",
- mpb->family_num,
+ super_table[i]->anchor->family_num,
super_table[i]->disks->major,
super_table[i]->disks->minor);
super_table[i] = s;