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

From: Steven Rostedt
Date: Sat Nov 23 2013 - 04:25:44 EST


On Sat, 23 Nov 2013 00:24:50 +0900
Namhyung Kim <namhyung@xxxxxxxxxx> 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;
> > +}
> > +
>
>

--
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/