lkml.org 
[lkml]   [2013]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/22] tools lib traceevent: Add scsi plugin
On Sat, 23 Nov 2013 00:24:50 +0900
Namhyung Kim <namhyung@kernel.org> wrote:


> [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.

This is because these are copied directly from the kernel, and the
kernel versions use the putc(0) too. But there, it is needed, as its up
to the helper function to terminate the trace_seq.

I need to add trace_seq_terminate() in the kernel (it's in
libtraceevent), so that we can replace the putc(0) with terminate, and
not truncate the seq early.

-- Steve


>
>
> > + return ret;
> > +}
> > +
>
>



\
 
 \ /
  Last update: 2013-11-23 10:41    [W:1.189 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site