Messages in this thread | | | Date | Sat, 23 Nov 2013 04:25:29 -0500 | From | Steven Rostedt <> | Subject | Re: [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; > > +} > > + > >
| |