Lines Matching full:s

31 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq)  argument
34 #define TRACE_SEQ_BUF_USED(s) seq_buf_used(&(s)->seq) argument
37 * trace_seq should work with being initialized with 0s.
39 static inline void __trace_seq_init(struct trace_seq *s) in __trace_seq_init() argument
41 if (unlikely(!s->seq.size)) in __trace_seq_init()
42 trace_seq_init(s); in __trace_seq_init()
48 * @s: the trace_seq descriptor that is the source.
54 int trace_print_seq(struct seq_file *m, struct trace_seq *s) in trace_print_seq() argument
58 __trace_seq_init(s); in trace_print_seq()
60 ret = seq_buf_print_seq(m, &s->seq); in trace_print_seq()
68 trace_seq_init(s); in trace_print_seq()
75 * @s: trace sequence descriptor
81 * buffer (@s). Then the output may be either used by
84 void trace_seq_printf(struct trace_seq *s, const char *fmt, ...) in trace_seq_printf() argument
86 unsigned int save_len = s->seq.len; in trace_seq_printf()
89 if (s->full) in trace_seq_printf()
92 __trace_seq_init(s); in trace_seq_printf()
95 seq_buf_vprintf(&s->seq, fmt, ap); in trace_seq_printf()
99 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_printf()
100 s->seq.len = save_len; in trace_seq_printf()
101 s->full = 1; in trace_seq_printf()
108 * @s: trace sequence descriptor
112 * Writes a ASCII representation of a bitmask string into @s.
114 void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, in trace_seq_bitmask() argument
117 unsigned int save_len = s->seq.len; in trace_seq_bitmask()
119 if (s->full) in trace_seq_bitmask()
122 __trace_seq_init(s); in trace_seq_bitmask()
124 seq_buf_printf(&s->seq, "%*pb", nmaskbits, maskp); in trace_seq_bitmask()
126 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bitmask()
127 s->seq.len = save_len; in trace_seq_bitmask()
128 s->full = 1; in trace_seq_bitmask()
135 * @s: trace sequence descriptor
141 * buffer (@s). Then the output may be either used by
144 void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) in trace_seq_vprintf() argument
146 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
148 if (s->full) in trace_seq_vprintf()
151 __trace_seq_init(s); in trace_seq_vprintf()
153 seq_buf_vprintf(&s->seq, fmt, args); in trace_seq_vprintf()
156 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_vprintf()
157 s->seq.len = save_len; in trace_seq_vprintf()
158 s->full = 1; in trace_seq_vprintf()
165 * @s: trace sequence descriptor
178 void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) in trace_seq_bprintf() argument
180 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
182 if (s->full) in trace_seq_bprintf()
185 __trace_seq_init(s); in trace_seq_bprintf()
187 seq_buf_bprintf(&s->seq, fmt, binary); in trace_seq_bprintf()
190 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_bprintf()
191 s->seq.len = save_len; in trace_seq_bprintf()
192 s->full = 1; in trace_seq_bprintf()
200 * @s: trace sequence descriptor
205 * into a special buffer (@s) for later retrieval by a sequencer
208 void trace_seq_puts(struct trace_seq *s, const char *str) in trace_seq_puts() argument
212 if (s->full) in trace_seq_puts()
215 __trace_seq_init(s); in trace_seq_puts()
217 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_puts()
218 s->full = 1; in trace_seq_puts()
222 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
228 * @s: trace sequence descriptor
233 * into a special buffer (@s) for later retrieval by a sequencer
236 void trace_seq_putc(struct trace_seq *s, unsigned char c) in trace_seq_putc() argument
238 if (s->full) in trace_seq_putc()
241 __trace_seq_init(s); in trace_seq_putc()
243 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_putc()
244 s->full = 1; in trace_seq_putc()
248 seq_buf_putc(&s->seq, c); in trace_seq_putc()
254 * @s: trace sequence descriptor
262 void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) in trace_seq_putmem() argument
264 if (s->full) in trace_seq_putmem()
267 __trace_seq_init(s); in trace_seq_putmem()
269 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem()
270 s->full = 1; in trace_seq_putmem()
274 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
280 * @s: trace sequence descriptor
288 void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, in trace_seq_putmem_hex() argument
291 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
293 if (s->full) in trace_seq_putmem_hex()
296 __trace_seq_init(s); in trace_seq_putmem_hex()
299 if (len * 2 > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem_hex()
300 s->full = 1; in trace_seq_putmem_hex()
305 seq_buf_putmem_hex(&s->seq, mem, len); in trace_seq_putmem_hex()
307 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_putmem_hex()
308 s->seq.len = save_len; in trace_seq_putmem_hex()
309 s->full = 1; in trace_seq_putmem_hex()
317 * @s: trace sequence descriptor
327 int trace_seq_path(struct trace_seq *s, const struct path *path) in trace_seq_path() argument
329 unsigned int save_len = s->seq.len; in trace_seq_path()
331 if (s->full) in trace_seq_path()
334 __trace_seq_init(s); in trace_seq_path()
336 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_path()
337 s->full = 1; in trace_seq_path()
341 seq_buf_path(&s->seq, path, "\n"); in trace_seq_path()
343 if (unlikely(seq_buf_has_overflowed(&s->seq))) { in trace_seq_path()
344 s->seq.len = save_len; in trace_seq_path()
345 s->full = 1; in trace_seq_path()
355 * @s: trace sequence descriptor
360 * by @ubuf. It starts from the last read position (@s->readpos)
362 * the content in the buffer (@s->len), which ever comes first.
369 * sequenc (@s->len == @s->readpos).
373 int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) in trace_seq_to_user() argument
375 __trace_seq_init(s); in trace_seq_to_user()
376 return seq_buf_to_user(&s->seq, ubuf, cnt); in trace_seq_to_user()