Re: [PATCH 12/22] tools lib traceevent: Add scsi plugin

From: Namhyung Kim
Date: Fri Nov 22 2013 - 10:25:05 EST


2013-11-21 (ë), 12:01 +0100, Jiri Olsa:
> Adding scsi plugin.
>
> This plugin adds fields resolving fucntions for following
> tracepoint events:
> scsi:scsi_dispatch_cmd_start
> scsi:scsi_dispatch_cmd_error
> scsi:scsi_dispatch_cmd_done
> scsi:scsi_dispatch_cmd_timeout
>
> The diff of 'perf script' output generated by old and new code:
> (data was generated by 'perf record -e 'scsi:scsi_dispatch_cmd*' -a)
>
> - swapper 0 [000] 6620.491019: scsi:scsi_dispatch_cmd_done: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 result=0 opcode=53 cmd_len=10 data_sglen=0 prot_sglen=0 prot_op=0 cmnd=5
> + swapper 0 [000] 6620.491019: scsi:scsi_dispatch_cmd_done: host_no=0 channel=0 id=0 lun=0 data_sgl=0 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
> - kworker/0:0 21554 [000] 6620.491126: scsi:scsi_dispatch_cmd_start: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 opcode=42 cmd_len=10 data_sglen=1 prot_sglen=0 prot_op=0 cmnd=*
> + kworker/0:0 21554 [000] 6620.491126: scsi:scsi_dispatch_cmd_start: host_no=0 channel=0 id=0 lun=0 data_sgl=1 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=570899168 txlen=8 protect=0 raw=2a 00 22 07 3a e0 00 00 08 00)
> - jbd2/dm-3-8 593 [002] 6621.607992: scsi:scsi_dispatch_cmd_error: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 rtn=4182 opcode=53 cmd_len=10 data_sglen=0 prot_sglen=0 prot_op=0 cmnd=5
> + jbd2/dm-3-8 593 [002] 6621.607992: scsi:scsi_dispatch_cmd_error: host_no=0 channel=0 id=0 lun=0 data_sgl=0 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00) rtn=4182
>
> NOTE I couldn't generated scsi_dispatch_cmd_timeout tracepoint,
> but it's similar to the rest, so I believe it's ok.

[SNIP]
> +static const char *
> +scsi_trace_rw6(struct trace_seq *p, unsigned char *cdb, int len)
> +{
> + const char *ret = p->buffer + p->len;
> + sector_t lba = 0, txlen = 0;
> +
> + lba |= ((cdb[1] & 0x1F) << 16);
> + lba |= (cdb[2] << 8);
> + lba |= cdb[3];
> + txlen = cdb[4];
> +
> + trace_seq_printf(p, "lba=%llu txlen=%llu",
> + (unsigned long long)lba, (unsigned long long)txlen);
> + trace_seq_putc(p, 0);

Why is this _putc(0) needed? It seems you added it to all other
functions too.


> + return ret;
> +}
> +



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/