1 // SPDX-License-Identifier: LGPL-2.1
3 * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
13 /* ----------------------- trace_seq ----------------------- */
15 #ifndef TRACE_SEQ_BUF_SIZE
16 #define TRACE_SEQ_BUF_SIZE 4096
21 TRACE_SEQ__BUFFER_POISONED
,
22 TRACE_SEQ__MEM_ALLOC_FAILED
,
26 * Trace sequences are used to allow a function to call several other functions
27 * to create a string of data to use (up to a max of PAGE_SIZE).
32 unsigned int buffer_size
;
35 enum trace_seq_fail state
;
38 void trace_seq_init(struct trace_seq
*s
);
39 void trace_seq_reset(struct trace_seq
*s
);
40 void trace_seq_destroy(struct trace_seq
*s
);
42 extern int trace_seq_printf(struct trace_seq
*s
, const char *fmt
, ...)
43 __attribute__ ((format (printf
, 2, 3)));
44 extern int trace_seq_vprintf(struct trace_seq
*s
, const char *fmt
, va_list args
)
45 __attribute__ ((format (printf
, 2, 0)));
47 extern int trace_seq_puts(struct trace_seq
*s
, const char *str
);
48 extern int trace_seq_putc(struct trace_seq
*s
, unsigned char c
);
50 extern void trace_seq_terminate(struct trace_seq
*s
);
52 extern int trace_seq_do_fprintf(struct trace_seq
*s
, FILE *fp
);
53 extern int trace_seq_do_printf(struct trace_seq
*s
);
55 #endif /* _TRACE_SEQ_H */