Re: [PATCH 1/2 v4] scsi: add __print_hex() to ftrace

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Thursday, April 1, 2010 - 6:57 am

On Thu, 2010-04-01 at 20:40 +0900, Kei Tokunaga wrote:

I would not put the putc(p, 0) into a helper function. This terminates
the buffer, and strings added to the trace_seq will go after the '\0'.

What we need is this in trace_seq.h:

static inline trace_seq_terminate(struct trace_seq *s)
{
	if (!s->full)
		s->buffer[s->len] = 0;
}

This will add a '0' to the buffer after the last string, but will not
increment length while doing it. Thus, new data added to the buffer
would still be appended correctly.

-- Steve



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2 v4] scsi: ftrace based scsi tracer, Kei Tokunaga, (Thu Apr 1, 4:37 am)
[PATCH 1/2 v4] scsi: add __print_hex() to ftrace, Kei Tokunaga, (Thu Apr 1, 4:40 am)
Re: [PATCH 1/2 v4] scsi: add __print_hex() to ftrace, Steven Rostedt, (Thu Apr 1, 6:57 am)
Re: [PATCH 1/2 v4] scsi: add __print_hex() to ftrace, Joe Perches, (Thu Apr 1, 10:03 am)