qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events
Date: Thu, 05 Sep 2013 03:26:25 +0200	[thread overview]
Message-ID: <5227DDC1.4000401@redhat.com> (raw)
In-Reply-To: <20130904142105.GD12733@stefanha-thinkpad.redhat.com>

On 09/04/13 16:21, Stefan Hajnoczi wrote:
> On Thu, Aug 29, 2013 at 03:37:50PM +0200, Laszlo Ersek wrote:
>> +static void dump_cmd_req(const VirtIOSCSIReq *req, uint32_t cdb_size)
>> +{
>> +    const VirtIOSCSICmdReq *cr;
>> +    char *cdb_hex;
>> +
>> +    if (!trace_event_get_state(TRACE_VIRTIO_SCSI_DUMP_CMD_REQ)) {
>> +        return;
>> +    }
>> +    cr = req->req.cmd;
>> +    cdb_hex = qemu_hexstr(cr->cdb, cdb_size, NULL);
>> +    trace_virtio_scsi_dump_cmd_req((void *)req, cr->tag,
>> +                                   virtio_scsi_get_lun((uint8_t *)cr->lun),
>> +                                   cdb_hex);
>> +    g_free(cdb_hex);
> 
> There is a halfway solution to disable expensive trace events that works
> across all backends (SystemTap, stderr, etc):
> 
> if (!TRACE_VIRTIO_SCSI_DUMP_CMD_REQ_ENABLED) {
>     return;
> }
> 
> This is a compile-time constant which can be toggled with the "disable"
> keyword in the ./trace-events file:
> 
> disable my_expensive_event(const char *foo) "foo %s"
> 
> See the bottom of docs/tracing.txt for full documentation on the
> "disable" keyword.

Yes, I've read it :)

The compile-time constant is already used (just not in an if() but in a
surrounding #if, snipped from the context above), and the corresponding
tracepoints are already disabled in ./trace-events.

I do read documentation if it exists.

I guess I'll rework this sometime later.

Thanks,
Laszlo

      reply	other threads:[~2013-09-05  1:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 13:36 [Qemu-devel] [PATCH 0/2] some virtio-scsi tracing Laszlo Ersek
2013-08-29 13:37 ` [Qemu-devel] [PATCH 1/2] qemu_hexstr(): hexdump a small buffer to a string, for in-line printing Laszlo Ersek
2013-08-29 16:32   ` Markus Armbruster
2013-08-29 13:37 ` [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events Laszlo Ersek
2013-08-29 13:59   ` Paolo Bonzini
2013-08-29 14:18     ` Laszlo Ersek
2013-08-29 14:53       ` Paolo Bonzini
2013-08-29 15:35         ` Laszlo Ersek
2013-08-29 15:42           ` Paolo Bonzini
2013-09-04 14:21   ` Stefan Hajnoczi
2013-09-05  1:26     ` Laszlo Ersek [this message]

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=5227DDC1.4000401@redhat.com \
    --to=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).