summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/include/osmocom/bb/l1sched/logging.h
blob: 21be9955a7b19044ad2bd3f0a7661b94cf80eafd (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
31
32
33
34
35
36
37
#pragma once

extern int l1sched_log_cat_common;
extern int l1sched_log_cat_data;

void l1sched_logging_init(int log_cat_common, int log_cat_data);

/* Messages using l1sched_state as the context */
#define LOGP_SCHED_CAT(sched, cat, level, fmt, args...) \
	LOGP(l1sched_log_cat_##cat, level, "%s" fmt, \
	     (sched)->log_prefix, ## args)

/* Common messages using l1sched_state as the context */
#define LOGP_SCHEDC(sched, level, fmt, args...) \
	LOGP_SCHED_CAT(sched, common, level, fmt, ## args)

/* Data messages using l1sched_state as the context */
#define LOGP_SCHEDD(sched, level, fmt, args...) \
	LOGP_SCHED_CAT(sched, data, level, fmt, ## args)


#define LOGP_LCHAN_NAME_FMT "TS%u-%s"
#define LOGP_LCHAN_NAME_ARGS(lchan) \
	(lchan)->ts->index, l1sched_lchan_desc[(lchan)->type].name

/* Messages using l1sched_lchan_state as the context */
#define LOGP_LCHAN_CAT(lchan, cat, level, fmt, args...) \
	LOGP_SCHED_CAT((lchan)->ts->sched, cat, level, LOGP_LCHAN_NAME_FMT " " fmt, \
		       LOGP_LCHAN_NAME_ARGS(lchan), ## args)

/* Common messages using l1sched_lchan_state as the context */
#define LOGP_LCHANC(lchan, level, fmt, args...) \
	LOGP_LCHAN_CAT(lchan, common, level, fmt, ## args)

/* Data messages using l1sched_lchan_state as the context */
#define LOGP_LCHAND(lchan, level, fmt, args...) \
	LOGP_LCHAN_CAT(lchan, data, level, fmt, ## args)