1
2#include <linux/kernel.h>
3#include <linux/string.h>
4
5#include "rtsx.h"
6
7#ifdef _MSG_TRACE
8
9void _rtsx_trace(struct rtsx_chip *chip, const char *file, const char *func,
10 int line)
11{
12 struct trace_msg_t *msg = &chip->trace_msg[chip->msg_idx];
13
14 file = kbasename(file);
15 dev_dbg(rtsx_dev(chip), "[%s][%s]:[%d]\n", file, func, line);
16
17 strncpy(msg->file, file, MSG_FILE_LEN - 1);
18 strncpy(msg->func, func, MSG_FUNC_LEN - 1);
19 msg->line = (u16)line;
20 get_current_time(msg->timeval_buf, TIME_VAL_LEN);
21 msg->valid = 1;
22
23 chip->msg_idx++;
24 if (chip->msg_idx >= TRACE_ITEM_CNT)
25 chip->msg_idx = 0;
26}
27#endif
28