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>
28 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq)
35 if (unlikely(!s->seq.size)) in __trace_seq_init()
40 * trace_print_seq - move the contents of trace_seq into a seq_file
54 ret = seq_buf_print_seq(m, &s->seq); in trace_print_seq()
68 * trace_seq_printf - sequence printing of trace information
80 unsigned int save_len = s->seq.len; in trace_seq_printf()
83 if (s->full) in trace_seq_printf()
89 seq_buf_vprintf(&s->seq, fmt, ap); in trace_seq_printf()
93 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_printf()
94 s->seq.len = save_len; in trace_seq_printf()
95 s->full = 1; in trace_seq_printf()
101 * trace_seq_bitmask - write a bitmask array in its ASCII representation
111 unsigned int save_len = s->seq.len; in trace_seq_bitmask()
113 if (s->full) in trace_seq_bitmask()
118 seq_buf_printf(&s->seq, "%*pb", nmaskbits, maskp); in trace_seq_bitmask()
120 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bitmask()
121 s->seq.len = save_len; in trace_seq_bitmask()
122 s->full = 1; in trace_seq_bitmask()
128 * trace_seq_vprintf - sequence printing of trace information
141 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
143 if (s->full) in trace_seq_vprintf()
148 seq_buf_vprintf(&s->seq, fmt, args); in trace_seq_vprintf()
151 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_vprintf()
152 s->seq.len = save_len; in trace_seq_vprintf()
153 s->full = 1; in trace_seq_vprintf()
159 * trace_seq_bprintf - Write the printf string from binary arguments
175 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
177 if (s->full) in trace_seq_bprintf()
182 seq_buf_bprintf(&s->seq, fmt, binary); in trace_seq_bprintf()
185 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bprintf()
186 s->seq.len = save_len; in trace_seq_bprintf()
187 s->full = 1; in trace_seq_bprintf()
194 * trace_seq_puts - trace sequence printing of simple string
207 if (s->full) in trace_seq_puts()
213 s->full = 1; in trace_seq_puts()
217 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
222 * trace_seq_putc - trace sequence printing of simple character
233 if (s->full) in trace_seq_putc()
239 s->full = 1; in trace_seq_putc()
243 seq_buf_putc(&s->seq, c); in trace_seq_putc()
248 * trace_seq_putmem - write raw data into the trace_seq buffer
259 if (s->full) in trace_seq_putmem()
265 s->full = 1; in trace_seq_putmem()
269 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
274 * trace_seq_putmem_hex - write raw memory into the buffer in ASCII hex
286 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
288 if (s->full) in trace_seq_putmem_hex()
295 s->full = 1; in trace_seq_putmem_hex()
300 seq_buf_putmem_hex(&s->seq, mem, len); in trace_seq_putmem_hex()
302 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_putmem_hex()
303 s->seq.len = save_len; in trace_seq_putmem_hex()
304 s->full = 1; in trace_seq_putmem_hex()
311 * trace_seq_path - copy a path into the sequence buffer
324 unsigned int save_len = s->seq.len; in trace_seq_path()
326 if (s->full) in trace_seq_path()
332 s->full = 1; in trace_seq_path()
336 seq_buf_path(&s->seq, path, "\n"); in trace_seq_path()
338 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_path()
339 s->seq.len = save_len; in trace_seq_path()
340 s->full = 1; in trace_seq_path()
349 * trace_seq_to_user - copy the sequence buffer to user space
355 * by @ubuf. It starts from the last read position (@s->readpos)
357 * the content in the buffer (@s->len), which ever comes first.
362 * On failure it returns -EBUSY if all of the content in the
364 * sequence (@s->len == @s->readpos).
366 * Returns -EFAULT if the copy to userspace fails.
372 ret = seq_buf_to_user(&s->seq, ubuf, s->readpos, cnt); in trace_seq_to_user()
374 s->readpos += ret; in trace_seq_to_user()
383 unsigned int save_len = s->seq.len; in trace_seq_hex_dump()
385 if (s->full) in trace_seq_hex_dump()
391 s->full = 1; in trace_seq_hex_dump()
395 seq_buf_hex_dump(&(s->seq), prefix_str, in trace_seq_hex_dump()
399 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_hex_dump()
400 s->seq.len = save_len; in trace_seq_hex_dump()
401 s->full = 1; in trace_seq_hex_dump()
410 * trace_seq_acquire - acquire seq buffer with size len
412 * @len: size of buffer to be acquired
414 * acquire buffer with size of @len from trace_seq for output usage,
425 if (!WARN_ON_ONCE(seq_buf_buffer_left(&s->seq) < len)) in trace_seq_acquire()
426 seq_buf_commit(&s->seq, len); in trace_seq_acquire()