From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 0/1] KVM: x86: improve the usability of the 'kvm_pio' tracepoint Date: Mon, 05 May 2014 15:10:19 +0800 Message-ID: <5367395B.6070100@linux.vnet.ibm.com> References: <1399046267-4677-1-git-send-email-uobergfe@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com To: Ulrich Obergfell , kvm@vger.kernel.org Return-path: Received: from e28smtp05.in.ibm.com ([122.248.162.5]:40106 "EHLO e28smtp05.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473AbaEEHJ1 (ORCPT ); Mon, 5 May 2014 03:09:27 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 May 2014 12:39:23 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 0A2EC1258054 for ; Mon, 5 May 2014 12:38:15 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4579P4G15138942 for ; Mon, 5 May 2014 12:39:26 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4579H9T017000 for ; Mon, 5 May 2014 12:39:18 +0530 In-Reply-To: <1399046267-4677-1-git-send-email-uobergfe@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/02/2014 11:57 PM, Ulrich Obergfell wrote: > The current implementation of the 'kvm_pio' tracepoint in emulator_pio_in_out() > only tells us that 'something' has been read from or written to an I/O port. To > improve the usability of the tracepoint, I propose to include the value/content > that has been read or written in the trace output. The proposed patch aims at > the more common case where a single 8-bit or 16-bit or 32-bit value has been > read or written -- it does not fully cover the case where 'count' is greater > than one. > > This is an example of what the patch can do (trace of PCI config space access). > > - on the host > > # trace-cmd record -e kvm:kvm_pio -f "(port >= 0xcf8) && (port <= 0xcff)" > /sys/kernel/debug/tracing/events/kvm/kvm_pio/filter > Hit Ctrl^C to stop recording > > - in a Linux guest > > # dd if=/sys/bus/pci/devices/0000:00:06.0/config bs=2 count=4 | hexdump > 4+0 records in > 4+0 records out > 8 bytes (8 B) copied, 0.000114056 s, 70.1 kB/s > 0000000 1af4 1001 0507 0010 > 0000008 > > - on the host > > # trace-cmd report > ... > qemu-kvm-23216 [001] 15211.994089: kvm_pio: pio_write > at 0xcf8 size 4 count 1 val 0x80003000 > qemu-kvm-23216 [001] 15211.994108: kvm_pio: pio_read > at 0xcfc size 2 count 1 val 0x1af4 > qemu-kvm-23216 [001] 15211.994129: kvm_pio: pio_write > at 0xcf8 size 4 count 1 val 0x80003000 > qemu-kvm-23216 [001] 15211.994136: kvm_pio: pio_read > at 0xcfe size 2 count 1 val 0x1001 > qemu-kvm-23216 [001] 15211.994143: kvm_pio: pio_write > at 0xcf8 size 4 count 1 val 0x80003004 > qemu-kvm-23216 [001] 15211.994150: kvm_pio: pio_read > at 0xcfc size 2 count 1 val 0x507 > qemu-kvm-23216 [001] 15211.994155: kvm_pio: pio_write > at 0xcf8 size 4 count 1 val 0x80003004 > qemu-kvm-23216 [001] 15211.994161: kvm_pio: pio_read > at 0xcfe size 2 count 1 val 0x10 > Nice. Could please check "perf kvm stat" to see if "--event=ioport" can work after your patch? Reviewed-by: Xiao Guangrong