提交 7db161f6 编写于 作者: D David Ahern 提交者: Stefan Hajnoczi

rocker: timestamp on the debug logs helps correlate with events in the VM

Signed-off-by: NDavid Ahern <dsahern@gmail.com>
Signed-off-by: NScott Feldman <sfeldma@gmail.com>
Signed-off-by: NJiri Pirko <jiri@resnulli.us>
Message-id: 1426306173-24884-10-git-send-email-sfeldma@gmail.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 de24d3f1
......@@ -23,7 +23,16 @@
#if defined(DEBUG_ROCKER)
# define DPRINTF(fmt, ...) \
do { fprintf(stderr, "ROCKER: " fmt, ## __VA_ARGS__); } while (0)
do { \
struct timeval tv; \
char timestr[64]; \
time_t now; \
gettimeofday(&tv, NULL); \
now = tv.tv_sec; \
strftime(timestr, sizeof(timestr), "%T", localtime(&now)); \
fprintf(stderr, "%s.%06ld ", timestr, tv.tv_usec); \
fprintf(stderr, "ROCKER: " fmt, ## __VA_ARGS__); \
} while (0)
#else
static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册