[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] add some virtio-scsi trace events |
Date: |
Thu, 05 Sep 2013 03:26:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8 |
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