summaryrefslogtreecommitdiff
path: root/include/linux/trace_seq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/trace_seq.h')
-rw-r--r--include/linux/trace_seq.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index 5a2c650d9e1c..d2b51007b3b9 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -2,10 +2,12 @@
#ifndef _LINUX_TRACE_SEQ_H
#define _LINUX_TRACE_SEQ_H
-#include <linux/seq_buf.h>
+#include <linux/printbuf.h>
#include <asm/page.h>
+struct seq_file;
+
/*
* Trace sequences are used to allow a function to call several other functions
* to create a string of data to use (up to a max of PAGE_SIZE).
@@ -13,14 +15,16 @@
struct trace_seq {
char buffer[PAGE_SIZE];
- struct seq_buf seq;
+ struct printbuf seq;
+ unsigned readpos;
int full;
};
static inline void
trace_seq_init(struct trace_seq *s)
{
- seq_buf_init(&s->seq, s->buffer, PAGE_SIZE);
+ s->seq = PRINTBUF_EXTERN(s->buffer, PAGE_SIZE);
+ s->readpos = 0;
s->full = 0;
}
@@ -39,7 +43,7 @@ trace_seq_init(struct trace_seq *s)
*/
static inline int trace_seq_used(struct trace_seq *s)
{
- return seq_buf_used(&s->seq);
+ return printbuf_written(&s->seq);
}
/**
@@ -54,7 +58,7 @@ static inline int trace_seq_used(struct trace_seq *s)
static inline char *
trace_seq_buffer_ptr(struct trace_seq *s)
{
- return s->buffer + seq_buf_used(&s->seq);
+ return s->buffer + printbuf_written(&s->seq);
}
/**
@@ -66,7 +70,7 @@ trace_seq_buffer_ptr(struct trace_seq *s)
*/
static inline bool trace_seq_has_overflowed(struct trace_seq *s)
{
- return s->full || seq_buf_has_overflowed(&s->seq);
+ return s->full || printbuf_overflowed(&s->seq);
}
/*
@@ -87,6 +91,7 @@ extern void trace_seq_putc(struct trace_seq *s, unsigned char c);
extern void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len);
extern void trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
unsigned int len);
+struct path;
extern int trace_seq_path(struct trace_seq *s, const struct path *path);
extern void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp,