From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAk4H-0001mx-4S for qemu-devel@nongnu.org; Fri, 15 Apr 2011 10:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAk4G-00080F-13 for qemu-devel@nongnu.org; Fri, 15 Apr 2011 10:32:17 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:51029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAk4F-00080B-Ui for qemu-devel@nongnu.org; Fri, 15 Apr 2011 10:32:15 -0400 Received: by yxk8 with SMTP id 8so1421148yxk.4 for ; Fri, 15 Apr 2011 07:32:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DA8549B.2020301@redhat.com> References: <1302873840-17161-1-git-send-email-pbonzini@redhat.com> <1302873840-17161-3-git-send-email-pbonzini@redhat.com> <4DA8549B.2020301@redhat.com> Date: Fri, 15 Apr 2011 15:32:15 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] add tracing of scsi requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Fri, Apr 15, 2011 at 3:22 PM, Paolo Bonzini wrote: > On 04/15/2011 04:15 PM, Stefan Hajnoczi wrote: >> >> On Fri, Apr 15, 2011 at 2:24 PM, Paolo Bonzini >> =A0wrote: >>> >>> +disable scsi_req_parsed(int target, int lun, int tag, int cmd, const >>> char *cmdname, int mode, int xfer, uint64_t lba) "target %d lun %d tag = %d >>> command %d (%s) dir %d length %d lba %"PRIu64"" >> >> Tracing strings isn't possible with all trace backends, so we should >> avoid it. =A0It works fine with stderr but other trace backends may not >> be in the same address space (they are unable to dereference pointers >> to strings) or simply not have the ability to record variable-length >> data. > > Yeah, I saw them. =A0What happens with the other backends? =A0Do they cra= sh or > do they just record bogus data? =A0If the latter (like IIRC simpletrace),= I'd > really like to keep the string. =A0It is duplicating the cmd argument, so= it > is possible to work without it on non-stderr backends; with stderr OTOH t= he > human-readable version is really useful before you have learnt the SCSI s= pec > by heart. :) There should be no crashes during tracing but if a pretty-printing tool uses the format string then there will be a crash :). Right now only stderr and ust use the format string. I've forgotten whether or not ust is happy with %s. Once we allow %s how long will it take until people use it without including the raw data? Basically, yes, you can get away with it in some cases but it's a slippery slope. I'd rather forbid it now than end up with a confusing or half-working mess later. Stefan