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