public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* How virtio-blk latency can be measured
@ 2013-12-15  8:06 Qingshu Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Qingshu Chen @ 2013-12-15  8:06 UTC (permalink / raw)
  To: kvm

hi,I want to calculate the latencyof virtio in kvm, I read the document
in http://www.linux-kvm.org/page/Virtio/Block/Latency and met some
problem.
1. when calculating latency in kvm, the document said  kvm_pio and
kvm_set_irq can be filtered using command 'lspci -vv -nn' and
'cat /proc/interrupts' , but I don't know how to use the result to
filter kvm_pio and kvm_set_irq.
2. Anyone know who is the author of this webpage:
http://www.linux-kvm.org/page/Virtio/Block/Latency .
Thank you.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* How virtio-blk latency can be measured
@ 2013-12-15  8:20 Qingshu Chen
  2013-12-17 10:51 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Qingshu Chen @ 2013-12-15  8:20 UTC (permalink / raw)
  To: kvm; +Cc: 1150163259

hi,I want to calculate the latencyof virtio in kvm, I read the document in
http://www.linux-kvm.org/page/Virtio/Block/Latency and met some problem.
1. when calculating latency in kvm, the document said  kvm_pio and
kvm_set_irq can be filtered using command 'lspci -vv -nn' and 'cat
/proc/interrupts' , but I don't know how to use the result to filter kvm_pio
and kvm_set_irq.
2. Anyone know who is the author of this webpage:
http://www.linux-kvm.org/page/Virtio/Block/Latency .
Thank you


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How virtio-blk latency can be measured
  2013-12-15  8:20 Qingshu Chen
@ 2013-12-17 10:51 ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-12-17 10:51 UTC (permalink / raw)
  To: Qingshu Chen; +Cc: kvm, 1150163259

On Sun, Dec 15, 2013 at 04:20:05PM +0800, Qingshu Chen wrote:
> hi,I want to calculate the latencyof virtio in kvm, I read the document in
> http://www.linux-kvm.org/page/Virtio/Block/Latency and met some problem.
> 1. when calculating latency in kvm, the document said  kvm_pio and
> kvm_set_irq can be filtered using command 'lspci -vv -nn' and 'cat
> /proc/interrupts' , but I don't know how to use the result to filter kvm_pio
> and kvm_set_irq.

Hi Qingshu,
I wrote that wiki page.  The commands on the wiki are:

  cd /sys/kernel/debug/tracing
  echo 'port == 0xc090' >events/kvm/kvm_pio/filter
  echo 'gsi == 26' >events/kvm/kvm_set_irq/filter
  echo 1 >events/kvm/kvm_pio/enable
  echo 1 >events/kvm/kvm_set_irq/enable
  cat trace_pipe >/tmp/trace

Here is how you can find the right port and gsi values to filter:

1. The 'kvm_pio' event is used to trace guest->host virtqueue
   notification.  Looking at drivers/virtio/virtio_pci.c reveals that
   the port is ioaddr + VIRTIO_PCI_QUEUE_NOTIFY (16).

   Here is an example:
   # lspci -vv -nn
   00:04.0 SCSI storage controller [0100]: Red Hat, Inc Virtio block device [1af4:1001]
   [...]
      Region 0: I/O ports at c080 [size=64]

   Therefore you need to filter on 0xc080 + 0x10 = 0xc090 to trace
   VIRTIO_PCI_QUEUE_NOTIFY accesses.

2. The 'kvm_set_irq' event is used to trace host->guest virtqueue
   notifications.

   Find the virtio driver instance:
   # ls /sys/block/vda/device/driver/
   bind  module  unbind  virtio1

   Now look up the virtqueue interrupt for 'virtio1':
   # cat /proc/interrupts
   [...]
   185:      35129          0          0          0          0 0       8760          0       PCI-MSI-X  virtio1-requests

   So gsi is 185.

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-17 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-15  8:06 How virtio-blk latency can be measured Qingshu Chen
  -- strict thread matches above, loose matches on Subject: below --
2013-12-15  8:20 Qingshu Chen
2013-12-17 10:51 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox