|
From: | Mark Wu |
Subject: | Re: [Qemu-devel] [PATCH 2/2] net: store correct timestamp in dump file |
Date: | Mon, 07 Nov 2011 14:44:04 +0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110927 Red Hat/3.1.15-1.el6_1 Thunderbird/3.1.15 |
On 11/07/2011 05:52 AM, Hervé Poussineau wrote:
I agree that using host time as timestamp is more reasonable than the virtual clock because in most cases rtc for guest is based on host time not virtual clock. I think we can simply use "host_clock" instead of "vm_clock" to achieve that. It will use the same time as host no matter what option is specified for guest's rtc. With your patch, the time stamp will keep the same as the choice of guest rtc, which is utc default.Signed-off-by: Hervé Poussineau<address@hidden> --- net/dump.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net/dump.c b/net/dump.c index 8132411..4b48d48 100644 --- a/net/dump.c +++ b/net/dump.c @@ -30,6 +30,7 @@ typedef struct DumpState { VLANClientState nc; + int64_t start_ts; int fd; int pcap_caplen; } DumpState; @@ -70,7 +71,7 @@ static ssize_t dump_receive(VLANClientState *nc, const uint8_t *buf, size_t size ts = muldiv64(qemu_get_clock_ns(vm_clock), 1000000, get_ticks_per_sec());
- ts = muldiv64(qemu_get_clock_ns(vm_clock), 1000000, get_ticks_per_sec()); + ts = muldiv64(qemu_get_clock_ns(host_clock), 1000000, get_ticks_per_sec());
caplen = size > s->pcap_caplen ? s->pcap_caplen : size;
[Prev in Thread] | Current Thread | [Next in Thread] |