monitor-mux: fix timestamp prefixes (Jan Kiszka)
rt_clock returns milliseconds. Fix mux'ed monitor terminal timestamps accordingly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6399 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7aea4412b6
commit
a4bb1db854
@ -241,13 +241,13 @@ static int mux_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
|
|||||||
if (term_timestamps_start == -1)
|
if (term_timestamps_start == -1)
|
||||||
term_timestamps_start = ti;
|
term_timestamps_start = ti;
|
||||||
ti -= term_timestamps_start;
|
ti -= term_timestamps_start;
|
||||||
secs = ti / 1000000000;
|
secs = ti / 1000;
|
||||||
snprintf(buf1, sizeof(buf1),
|
snprintf(buf1, sizeof(buf1),
|
||||||
"[%02d:%02d:%02d.%03d] ",
|
"[%02d:%02d:%02d.%03d] ",
|
||||||
secs / 3600,
|
secs / 3600,
|
||||||
(secs / 60) % 60,
|
(secs / 60) % 60,
|
||||||
secs % 60,
|
secs % 60,
|
||||||
(int)((ti / 1000000) % 1000));
|
(int)(ti % 1000));
|
||||||
d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1));
|
d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user