/* The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (@s). Then the output may be either used by the sequencer or pulled into another buffer.  */
int trace_seq_printf(struct trace_seq *s, const char *fmt,...)
/* The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (@s). Then the output may be either used by the sequencer or pulled into another buffer.  */
int trace_seq_printf(struct trace_seq *s, const char *fmt,...)
{
	int len = (PAGE_SIZE - 1) - s->len;
	va_list ap;
	int ret;
	if (s->full || !len)
		return 0;
	va_start(ap, fmt);
	ret = vsnprintf(s->buffer + s->len, len, fmt, ap);
	va_end(ap);
	if (ret >= len) {
		s->full = 1;
		return 0;
	}
	s->len += ret;
	return 1;
}