aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/debug.h
blob: dd7816823231fe8b416def1e8050b6be931209c3 (plain)
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
#pragma once

#include <stdbool.h>
#include <sys/types.h>

#include <osmocom/core/logging.h>

extern const struct log_info log_info;

/* Debug Areas of the code */
enum {
	DMAIN,
	DTRXCLK,
	DTRXCTRL,
	DTRXDDL,
	DTRXDUL,
	DDEV,
	DDEVDRV,
	DCTR,
};

pid_t my_gettid(void);

#define CLOGC(category, level, fmt, args...) do { \
	LOGP(category, level, "[tid=%ld] " fmt, (long int) my_gettid(), ##args);  \
} while(0)

#define CLOGCHAN(chan, category, level, fmt, args...) do { \
	LOGP(category, level, "[tid=%ld][chan=%zu] " fmt, (long int) my_gettid(), chan, ##args);  \
} while(0)