Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84099f52 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: Debug: make logging in debug buffer more coherent"

parents fe0b9a7c cbd42421
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -26,11 +26,17 @@ extern void add_event_to_buf(char *tbuf);
extern int debug_debugfs_init(void);
extern void debug_debugfs_exit(void);

#define log_event(dlog, x...)						\
#define LOGLEVEL_NONE 8
#define LOGLEVEL_DEBUG 7
#define LOGLEVEL_ERR 3

#define log_event(log_level, x...)					\
do {									\
	char buf[160];							\
	if (dlog)							\
	if (log_level == LOGLEVEL_DEBUG)				\
		pr_debug(x);						\
	else if (log_level == LOGLEVEL_ERR)				\
		pr_err(x);						\
	if (enable_event_log) {						\
		put_timestamp(buf);					\
		snprintf(&buf[TIME_BUF_LEN - 1], DBG_EVENT_LEN, x);	\
@@ -38,4 +44,8 @@ do { \
	}								\
} while (0)

#define log_event_none(x, ...) log_event(LOGLEVEL_NONE, x, ##__VA_ARGS__)
#define log_event_dbg(x, ...) log_event(LOGLEVEL_DEBUG, x, ##__VA_ARGS__)
#define log_event_err(x, ...) log_event(LOGLEVEL_ERR, x, ##__VA_ARGS__)

#endif	/* __DEBUG_H_ */