Lines Matching refs:s
31 #define TRACE_SEQ_BUF_LEFT(s) seq_buf_buffer_left(&(s)->seq) argument
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()
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()
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()
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()
141 void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) in trace_seq_vprintf() argument
143 unsigned int save_len = s->seq.len; in trace_seq_vprintf()
145 if (s->full) in trace_seq_vprintf()
148 __trace_seq_init(s); 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()
175 void trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) in trace_seq_bprintf() argument
177 unsigned int save_len = s->seq.len; in trace_seq_bprintf()
179 if (s->full) in trace_seq_bprintf()
182 __trace_seq_init(s); 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()
205 void trace_seq_puts(struct trace_seq *s, const char *str) in trace_seq_puts() argument
209 if (s->full) in trace_seq_puts()
212 __trace_seq_init(s); in trace_seq_puts()
214 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_puts()
215 s->full = 1; in trace_seq_puts()
219 seq_buf_putmem(&s->seq, str, len); in trace_seq_puts()
233 void trace_seq_putc(struct trace_seq *s, unsigned char c) in trace_seq_putc() argument
235 if (s->full) in trace_seq_putc()
238 __trace_seq_init(s); in trace_seq_putc()
240 if (TRACE_SEQ_BUF_LEFT(s) < 1) { in trace_seq_putc()
241 s->full = 1; in trace_seq_putc()
245 seq_buf_putc(&s->seq, c); in trace_seq_putc()
259 void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) in trace_seq_putmem() argument
261 if (s->full) in trace_seq_putmem()
264 __trace_seq_init(s); in trace_seq_putmem()
266 if (len > TRACE_SEQ_BUF_LEFT(s)) { in trace_seq_putmem()
267 s->full = 1; in trace_seq_putmem()
271 seq_buf_putmem(&s->seq, mem, len); in trace_seq_putmem()
285 void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, in trace_seq_putmem_hex() argument
288 unsigned int save_len = s->seq.len; in trace_seq_putmem_hex()
290 if (s->full) in trace_seq_putmem_hex()
293 __trace_seq_init(s); in trace_seq_putmem_hex()
296 if (len * 2 > TRACE_SEQ_BUF_LEFT(s)) { 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()
324 int trace_seq_path(struct trace_seq *s, const struct path *path) in trace_seq_path() argument
326 unsigned int save_len = s->seq.len; in trace_seq_path()
328 if (s->full) in trace_seq_path()
331 __trace_seq_init(s); in trace_seq_path()
333 if (TRACE_SEQ_BUF_LEFT(s) < 1) { 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()
370 int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) in trace_seq_to_user() argument
372 __trace_seq_init(s); in trace_seq_to_user()
373 return seq_buf_to_user(&s->seq, ubuf, cnt); in trace_seq_to_user()
377 int trace_seq_hex_dump(struct trace_seq *s, const char *prefix_str, in trace_seq_hex_dump() argument
381 unsigned int save_len = s->seq.len; in trace_seq_hex_dump()
383 if (s->full) in trace_seq_hex_dump()
386 __trace_seq_init(s); in trace_seq_hex_dump()
388 if (TRACE_SEQ_BUF_LEFT(s) < 1) { 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()