All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Thompson <cthomp@cs.umn.edu>
To: kvm@vger.kernel.org
Subject: Trouble adding kvm clock trace to qemu-kvm
Date: Sat, 30 Apr 2011 12:00:30 -0500	[thread overview]
Message-ID: <4DBC402E.1080103@cs.umn.edu> (raw)

I'm trying to add a trace to qemu-kvm that will log the value of the 
vcpu's clock when a specific interrupt gets pushed. I'm working with 
qemu-kvm-0.14.0 on the 2.6.32-31 kernel. I've added the following to 
kvm_arch_try_push_interrupts in qemu-kvm-x86.c:

if (irq == 41) {
     // Get the VCPU's TSC
     struct kvm_clock_data clock;
     kvm_vcpu_ioctl(env, KVM_GET_CLOCK, &clock);
     uint64_t ticks = clock.clock;
     trace_kvm_clock_at_injection(ticks);
}

And here's the trace event I added:

kvm_clock_at_injection(uint64_t ticks) "interrupt 41 at clock %"PRIu64""

I have that trace and the virtio_blk_req_complete trace enabled. An 
excerpt from the resulting trace output from simpletrace.py:

virtio_blk_req_complete 288390365546367 30461.681 req=46972352 status=0
kvm_clock_at_injection 288390365546578 0.211 ticks=46972352
virtio_blk_req_complete 288390394870065 29323.487 req=46972352 status=0
kvm_clock_at_injection 288390394870276 0.211 ticks=46972352

Am I getting the guest's clock incorrectly? And even if so, why is it 
the same as the request pointer that virtio_blk_req_complete reports?

Any ideas are appreciated.

Thanks,

Chris

             reply	other threads:[~2011-04-30 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30 17:00 Chris Thompson [this message]
2011-05-09  9:12 ` Trouble adding kvm clock trace to qemu-kvm Avi Kivity
2011-05-09 12:27 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DBC402E.1080103@cs.umn.edu \
    --to=cthomp@cs.umn.edu \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.