From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF3bm-0006L8-BD for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:54:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF3bg-0000h2-B3 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:54:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF3bg-0000gu-2T for qemu-devel@nongnu.org; Thu, 29 Aug 2013 10:53:56 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7TErtRS007163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Aug 2013 10:53:55 -0400 Message-ID: <521F607F.70001@redhat.com> Date: Thu, 29 Aug 2013 16:53:51 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <521F4E76.2090507@redhat.com> <1377783470-8981-2-git-send-email-lersek@redhat.com> <521F53A6.7070200@redhat.com> <521F581A.50301@redhat.com> In-Reply-To: <521F581A.50301@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org Il 29/08/2013 16:18, Laszlo Ersek ha scritto: > On 08/29/13 15:59, Paolo Bonzini wrote: >> Il 29/08/2013 15:37, Laszlo Ersek ha scritto: >>> The events that log a hexdump of the cdb and the sense buffer are disabled >>> by default, because they require more processing than a simple trace_XXX() >>> function call. >>> >>> Signed-off-by: Laszlo Ersek >> >> trace_event_get_state doesn't work with the dtrace backend. Can you >> prepare v2 without those tracepoints? > > (a) I was just following "docs/tracing.txt"; see the last section in > there. > > (b) If I kill those two events, this is what you get: > > Incoming request: > > virtio_scsi_handle_cmd_enter vdev 0x7f1be4054468 vq 0x7f1be4054b60 > virtio_scsi_pop_req req 0x7f1be5d77650 > virtio_scsi_handle_cmd_exit vdev 0x7f1be4054468 vq 0x7f1be4054b60 > > This gives you the address of the request, so you can look up the > corresponding completion. However you don't know the actual command > (cdb) without "virtio_scsi_dump_cmd_req". Yes, but you can see almost all of the cdb from scsi_req_parsed and scsi_req_parsed_lba. > virtio_scsi_command_complete_enter req 0x7f1be5d77650 status 2 resid 0 > virtio_scsi_complete_req_enter req 0x7f1be5d77650 > virtio_scsi_complete_req_exit req 0x7f1be5d77650 > virtio_scsi_command_complete_exit req 0x7f1be5d77650 status 2 resid 0 sense_len 18 > > this will not tell you the virtio-scsi transport response code, or the > actual sense data. Same here: scsi_req_build_sense can give the sense data, and we could add another tracepoint scsi_req_complete for the response code. > (c) The way I submitted the series, the events in question are disabled > in "trace-events". Check out the functions themselves: they are > protected (ie. even the trace_event_get_state() calls are protected) > with preprocessing directives. I did it this way because I call them in > several places, and I wanted to keep the #if's centralized. Tracing was supposed to remove the need for #if... :) I'll try to salvage the patch. Paolo