Lines Matching full:s

28 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq)  argument
31 * trace_seq should work with being initialized with 0s.
33 static inline void __trace_seq_init(struct trace_seq *s) in __trace_seq_init() argument
35 if (unlikely(!s->seq.size)) in __trace_seq_init()
36 trace_seq_init(s); in __trace_seq_init()
42 * @s: the trace_seq descriptor that is the source.
48 int trace_print_seq(struct seq_file *m, struct trace_seq *s) in trace_print_seq() argument
52 __trace_seq_init(s); in trace_print_seq()
54 ret = seq_buf_print_seq(m, &s->seq); in trace_print_seq()
62 trace_seq_init(s); in trace_print_seq()
69 * @s: trace sequence descriptor
75 * buffer (@s). Then the output may be either used by
78 void trace_seq_printf(struct trace_seq *s, const char *fmt, ...) in trace_seq_printf() argument
80 unsigned int save_len = s->seq.len; in trace_seq_printf()
83 if (s->full) in trace_seq_printf()
86 __trace_seq_init(s); 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()
102 * @s: trace sequence descriptor
106 * Writes a ASCII representation of a bitmask string into @s.
108 void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, in trace_seq_bitmask() argument
111 unsigned int save_len = s->seq.len; in trace_seq_bitmask()
113 if (s->full) in trace_seq_bitmask()
116 __trace_seq_init(s); 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()
129 * @s: trace sequence descriptor
136 * buffer (@s). Then the output may be either used by
139 void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) in trace_seq_vprintf() argument
141 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
143 if (s->full) in trace_seq_vprintf()
146 __trace_seq_init(s); 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()
160 * @s: trace sequence descriptor
173 void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) in trace_seq_bprintf() argument
175 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
177 if (s->full) in trace_seq_bprintf()
180 __trace_seq_init(s); 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()
195 * @s: trace sequence descriptor
200 * into a special buffer (@s) for later retrieval by a sequencer
203 void trace_seq_puts(struct trace_seq *s, const char *str) in trace_seq_puts() argument
207 if (s->full) in trace_seq_puts()
210 __trace_seq_init(s); in trace_seq_puts()
212 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_puts()
213 s->full = 1; in trace_seq_puts()
217 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
223 * @s: trace sequence descriptor
228 * into a special buffer (@s) for later retrieval by a sequencer
231 void trace_seq_putc(struct trace_seq *s, unsigned char c) in trace_seq_putc() argument
233 if (s->full) in trace_seq_putc()
236 __trace_seq_init(s); in trace_seq_putc()
238 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_putc()
239 s->full = 1; in trace_seq_putc()
243 seq_buf_putc(&s->seq, c); in trace_seq_putc()
249 * @s: trace sequence descriptor
257 void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) in trace_seq_putmem() argument
259 if (s->full) in trace_seq_putmem()
262 __trace_seq_init(s); in trace_seq_putmem()
264 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem()
265 s->full = 1; in trace_seq_putmem()
269 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
275 * @s: trace sequence descriptor
283 void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, in trace_seq_putmem_hex() argument
286 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
288 if (s->full) in trace_seq_putmem_hex()
291 __trace_seq_init(s); in trace_seq_putmem_hex()
294 if (len * 2 > TRACE_SEQ_BUF_LEFT(s)) { 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()
312 * @s: trace sequence descriptor
322 int trace_seq_path(struct trace_seq *s, const struct path *path) in trace_seq_path() argument
324 unsigned int save_len = s->seq.len; in trace_seq_path()
326 if (s->full) in trace_seq_path()
329 __trace_seq_init(s); in trace_seq_path()
331 if (TRACE_SEQ_BUF_LEFT(s) < 1) { 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()
350 * @s: trace sequence descriptor
355 * by @ubuf. It starts from the last read position (@s->readpos)
357 * the content in the buffer (@s->len), which ever comes first.
364 * sequence (@s->len == @s->readpos).
368 int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) in trace_seq_to_user() argument
371 __trace_seq_init(s); in trace_seq_to_user()
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()
379 int trace_seq_hex_dump(struct trace_seq *s, const char *prefix_str, in trace_seq_hex_dump() argument
383 unsigned int save_len = s->seq.len; in trace_seq_hex_dump()
385 if (s->full) in trace_seq_hex_dump()
388 __trace_seq_init(s); in trace_seq_hex_dump()
390 if (TRACE_SEQ_BUF_LEFT(s) < 1) { 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()
411 * @s: trace sequence descriptor
421 char *trace_seq_acquire(struct trace_seq *s, unsigned int len) in trace_seq_acquire() argument
423 char *ret = trace_seq_buffer_ptr(s); in trace_seq_acquire()
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()