Lines Matching full:s
31 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq) argument
34 * trace_seq should work with being initialized with 0s.
36 static inline void __trace_seq_init(struct trace_seq *s) in __trace_seq_init() argument
38 if (unlikely(!s->seq.size)) in __trace_seq_init()
39 trace_seq_init(s); in __trace_seq_init()
45 * @s: the trace_seq descriptor that is the source.
51 int trace_print_seq(struct seq_file *m, struct trace_seq *s) in trace_print_seq() argument
55 __trace_seq_init(s); in trace_print_seq()
57 ret = seq_buf_print_seq(m, &s->seq); in trace_print_seq()
65 trace_seq_init(s); in trace_print_seq()
72 * @s: trace sequence descriptor
78 * buffer (@s). Then the output may be either used by
81 void trace_seq_printf(struct trace_seq *s, const char *fmt, ...) in trace_seq_printf() argument
83 unsigned int save_len = s->seq.len; in trace_seq_printf()
86 if (s->full) in trace_seq_printf()
89 __trace_seq_init(s); in trace_seq_printf()
92 seq_buf_vprintf(&s->seq, fmt, ap); in trace_seq_printf()
96 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_printf()
97 s->seq.len = save_len; in trace_seq_printf()
98 s->full = 1; in trace_seq_printf()
105 * @s: trace sequence descriptor
109 * Writes a ASCII representation of a bitmask string into @s.
111 void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, in trace_seq_bitmask() argument
114 unsigned int save_len = s->seq.len; in trace_seq_bitmask()
116 if (s->full) in trace_seq_bitmask()
119 __trace_seq_init(s); in trace_seq_bitmask()
121 seq_buf_printf(&s->seq, "%*pb", nmaskbits, maskp); in trace_seq_bitmask()
123 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bitmask()
124 s->seq.len = save_len; in trace_seq_bitmask()
125 s->full = 1; in trace_seq_bitmask()
132 * @s: trace sequence descriptor
139 * buffer (@s). Then the output may be either used by
142 void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) in trace_seq_vprintf() argument
144 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
146 if (s->full) in trace_seq_vprintf()
149 __trace_seq_init(s); in trace_seq_vprintf()
151 seq_buf_vprintf(&s->seq, fmt, args); in trace_seq_vprintf()
154 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_vprintf()
155 s->seq.len = save_len; in trace_seq_vprintf()
156 s->full = 1; in trace_seq_vprintf()
163 * @s: trace sequence descriptor
176 void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) in trace_seq_bprintf() argument
178 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
180 if (s->full) in trace_seq_bprintf()
183 __trace_seq_init(s); in trace_seq_bprintf()
185 seq_buf_bprintf(&s->seq, fmt, binary); in trace_seq_bprintf()
188 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bprintf()
189 s->seq.len = save_len; in trace_seq_bprintf()
190 s->full = 1; in trace_seq_bprintf()
198 * @s: trace sequence descriptor
203 * into a special buffer (@s) for later retrieval by a sequencer
206 void trace_seq_puts(struct trace_seq *s, const char *str) in trace_seq_puts() argument
210 if (s->full) in trace_seq_puts()
213 __trace_seq_init(s); in trace_seq_puts()
215 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_puts()
216 s->full = 1; in trace_seq_puts()
220 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
226 * @s: trace sequence descriptor
231 * into a special buffer (@s) for later retrieval by a sequencer
234 void trace_seq_putc(struct trace_seq *s, unsigned char c) in trace_seq_putc() argument
236 if (s->full) in trace_seq_putc()
239 __trace_seq_init(s); in trace_seq_putc()
241 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_putc()
242 s->full = 1; in trace_seq_putc()
246 seq_buf_putc(&s->seq, c); in trace_seq_putc()
252 * @s: trace sequence descriptor
260 void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) in trace_seq_putmem() argument
262 if (s->full) in trace_seq_putmem()
265 __trace_seq_init(s); in trace_seq_putmem()
267 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem()
268 s->full = 1; in trace_seq_putmem()
272 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
278 * @s: trace sequence descriptor
286 void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, in trace_seq_putmem_hex() argument
289 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
291 if (s->full) in trace_seq_putmem_hex()
294 __trace_seq_init(s); in trace_seq_putmem_hex()
297 if (len * 2 > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem_hex()
298 s->full = 1; in trace_seq_putmem_hex()
303 seq_buf_putmem_hex(&s->seq, mem, len); in trace_seq_putmem_hex()
305 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_putmem_hex()
306 s->seq.len = save_len; in trace_seq_putmem_hex()
307 s->full = 1; in trace_seq_putmem_hex()
315 * @s: trace sequence descriptor
325 int trace_seq_path(struct trace_seq *s, const struct path *path) in trace_seq_path() argument
327 unsigned int save_len = s->seq.len; in trace_seq_path()
329 if (s->full) in trace_seq_path()
332 __trace_seq_init(s); in trace_seq_path()
334 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_path()
335 s->full = 1; in trace_seq_path()
339 seq_buf_path(&s->seq, path, "\n"); in trace_seq_path()
341 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_path()
342 s->seq.len = save_len; in trace_seq_path()
343 s->full = 1; in trace_seq_path()
353 * @s: trace sequence descriptor
358 * by @ubuf. It starts from the last read position (@s->readpos)
360 * the content in the buffer (@s->len), which ever comes first.
367 * sequence (@s->len == @s->readpos).
371 int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) in trace_seq_to_user() argument
373 __trace_seq_init(s); in trace_seq_to_user()
374 return seq_buf_to_user(&s->seq, ubuf, cnt); in trace_seq_to_user()
378 int trace_seq_hex_dump(struct trace_seq *s, const char *prefix_str, in trace_seq_hex_dump() argument
382 unsigned int save_len = s->seq.len; in trace_seq_hex_dump()
384 if (s->full) in trace_seq_hex_dump()
387 __trace_seq_init(s); in trace_seq_hex_dump()
389 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_hex_dump()
390 s->full = 1; in trace_seq_hex_dump()
394 seq_buf_hex_dump(&(s->seq), prefix_str, in trace_seq_hex_dump()
398 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_hex_dump()
399 s->seq.len = save_len; in trace_seq_hex_dump()
400 s->full = 1; in trace_seq_hex_dump()
410 * @s: trace sequence descriptor
420 char *trace_seq_acquire(struct trace_seq *s, unsigned int len) in trace_seq_acquire() argument
422 char *ret = trace_seq_buffer_ptr(s); in trace_seq_acquire()
424 if (!WARN_ON_ONCE(seq_buf_buffer_left(&s->seq) < len)) in trace_seq_acquire()
425 seq_buf_commit(&s->seq, len); in trace_seq_acquire()