From: Stefan Hajnoczi <stefanha@gmail.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events
Date: Wed, 4 Sep 2013 16:21:05 +0200 [thread overview]
Message-ID: <20130904142105.GD12733@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1377783470-8981-2-git-send-email-lersek@redhat.com>
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.
Stefan
next prev parent reply other threads:[~2013-09-04 14:21 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 [this message]
2013-09-05 1:26 ` Laszlo Ersek
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=20130904142105.GD12733@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).