Lines Matching +full:full +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2008-2014 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
16 * The buffer size is currently PAGE_SIZE, although it may become dynamic
31 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq)
38 if (unlikely(!s->seq.size)) in __trace_seq_init()
43 * trace_print_seq - move the contents of trace_seq into a seq_file
57 ret = seq_buf_print_seq(m, &s->seq); in trace_print_seq()
71 * trace_seq_printf - sequence printing of trace information
83 unsigned int save_len = s->seq.len; in trace_seq_printf()
86 if (s->full) 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()
104 * trace_seq_bitmask - write a bitmask array in its ASCII representation
114 unsigned int save_len = s->seq.len; in trace_seq_bitmask()
116 if (s->full) 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()
131 * trace_seq_vprintf - sequence printing of trace information
143 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
145 if (s->full) in trace_seq_vprintf()
150 seq_buf_vprintf(&s->seq, fmt, args); in trace_seq_vprintf()
153 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_vprintf()
154 s->seq.len = save_len; in trace_seq_vprintf()
155 s->full = 1; in trace_seq_vprintf()
161 * trace_seq_bprintf - Write the printf string from binary arguments
177 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
179 if (s->full) in trace_seq_bprintf()
184 seq_buf_bprintf(&s->seq, fmt, binary); in trace_seq_bprintf()
187 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bprintf()
188 s->seq.len = save_len; in trace_seq_bprintf()
189 s->full = 1; in trace_seq_bprintf()
196 * trace_seq_puts - trace sequence printing of simple string
209 if (s->full) in trace_seq_puts()
215 s->full = 1; in trace_seq_puts()
219 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
224 * trace_seq_putc - trace sequence printing of simple character
235 if (s->full) in trace_seq_putc()
241 s->full = 1; in trace_seq_putc()
245 seq_buf_putc(&s->seq, c); in trace_seq_putc()
250 * trace_seq_putmem - write raw data into the trace_seq buffer
261 if (s->full) in trace_seq_putmem()
267 s->full = 1; in trace_seq_putmem()
271 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
276 * trace_seq_putmem_hex - write raw memory into the buffer in ASCII hex
288 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
290 if (s->full) in trace_seq_putmem_hex()
297 s->full = 1; in trace_seq_putmem_hex()
302 seq_buf_putmem_hex(&s->seq, mem, len); in trace_seq_putmem_hex()
304 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_putmem_hex()
305 s->seq.len = save_len; in trace_seq_putmem_hex()
306 s->full = 1; in trace_seq_putmem_hex()
313 * trace_seq_path - copy a path into the sequence buffer
326 unsigned int save_len = s->seq.len; in trace_seq_path()
328 if (s->full) in trace_seq_path()
334 s->full = 1; in trace_seq_path()
338 seq_buf_path(&s->seq, path, "\n"); in trace_seq_path()
340 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_path()
341 s->seq.len = save_len; in trace_seq_path()
342 s->full = 1; in trace_seq_path()
351 * trace_seq_to_user - copy the sequence buffer to user space
357 * by @ubuf. It starts from the last read position (@s->readpos)
359 * the content in the buffer (@s->len), which ever comes first.
364 * On failure it returns -EBUSY if all of the content in the
366 * sequence (@s->len == @s->readpos).
368 * Returns -EFAULT if the copy to userspace fails.
373 return seq_buf_to_user(&s->seq, ubuf, cnt); in trace_seq_to_user()
381 unsigned int save_len = s->seq.len; in trace_seq_hex_dump()
383 if (s->full) in trace_seq_hex_dump()
389 s->full = 1; in trace_seq_hex_dump()
393 seq_buf_hex_dump(&(s->seq), prefix_str, in trace_seq_hex_dump()
397 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_hex_dump()
398 s->seq.len = save_len; in trace_seq_hex_dump()
399 s->full = 1; in trace_seq_hex_dump()