From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755944Ab3KVPZA (ORCPT ); Fri, 22 Nov 2013 10:25:00 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:37422 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755928Ab3KVPY6 (ORCPT ); Fri, 22 Nov 2013 10:24:58 -0500 Subject: Re: [PATCH 12/22] tools lib traceevent: Add scsi plugin From: Namhyung Kim To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Corey Ashford , Frederic Weisbecker , Ingo Molnar , Paul Mackerras , Peter Zijlstra , Arnaldo Carvalho de Melo , Steven Rostedt , David Ahern , "Martin K. Petersen" In-Reply-To: <1385031680-9014-13-git-send-email-jolsa@redhat.com> References: <1385031680-9014-1-git-send-email-jolsa@redhat.com> <1385031680-9014-13-git-send-email-jolsa@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 23 Nov 2013 00:24:50 +0900 Message-ID: <1385133890.1747.101.camel@leonhard> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > +} > +