mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-18 15:28:43 +00:00
IOC mediator: DEBUG: support IOC log file
This patch is used for IOC mediator debugging. Due to IOC message logs are too much, need to save into one file instead of output stdout directly. By default, the debug log is disabled. Signed-off-by: Liu Yuan <yuan1.liu@intel.com> Reviewed-by: Wang Yu <yu1.wang@intel.com> Reviewed-by: Liu Shuo <shuo.a.liu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -41,9 +41,11 @@
|
||||
* Debug printf
|
||||
*/
|
||||
static int ioc_cbc_debug;
|
||||
#define DPRINTF(fmt, args...) \
|
||||
do { if (ioc_cbc_debug) printf(fmt, ##args); } while (0)
|
||||
#define WPRINTF(fmt, args...) printf(fmt, ##args)
|
||||
static FILE *dbg_file;
|
||||
#define DPRINTF(format, arg...) \
|
||||
do { if (ioc_cbc_debug && dbg_file) { fprintf(dbg_file, format, arg);\
|
||||
fflush(dbg_file); } } while (0)
|
||||
#define WPRINTF(format, arg...) printf(format, ##arg)
|
||||
|
||||
static void cbc_send_pkt(struct cbc_pkt *pkt);
|
||||
|
||||
@@ -895,3 +897,12 @@ wlist_init_signal(struct cbc_signal *cbc_tbl, size_t cbc_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Share log file with IOC.
|
||||
*/
|
||||
void
|
||||
cbc_set_log_file(FILE *f)
|
||||
{
|
||||
dbg_file = f;
|
||||
}
|
||||
|
Reference in New Issue
Block a user