diff options
Diffstat (limited to 'include/linux/trace_seq.h')
-rw-r--r-- | include/linux/trace_seq.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 136116924d8d..ea6c9dea79e3 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -25,6 +25,21 @@ trace_seq_init(struct trace_seq *s) | |||
25 | s->full = 0; | 25 | s->full = 0; |
26 | } | 26 | } |
27 | 27 | ||
28 | /** | ||
29 | * trace_seq_buffer_ptr - return pointer to next location in buffer | ||
30 | * @s: trace sequence descriptor | ||
31 | * | ||
32 | * Returns the pointer to the buffer where the next write to | ||
33 | * the buffer will happen. This is useful to save the location | ||
34 | * that is about to be written to and then return the result | ||
35 | * of that write. | ||
36 | */ | ||
37 | static inline unsigned char * | ||
38 | trace_seq_buffer_ptr(struct trace_seq *s) | ||
39 | { | ||
40 | return s->buffer + s->len; | ||
41 | } | ||
42 | |||
28 | /* | 43 | /* |
29 | * Currently only defined when tracing is enabled. | 44 | * Currently only defined when tracing is enabled. |
30 | */ | 45 | */ |
@@ -36,14 +51,13 @@ int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); | |||
36 | extern int | 51 | extern int |
37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 52 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); | 53 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
39 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 54 | extern int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
40 | size_t cnt); | 55 | int cnt); |
41 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | 56 | extern int trace_seq_puts(struct trace_seq *s, const char *str); |
42 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); | 57 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); |
43 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len); | 58 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len); |
44 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 59 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
45 | size_t len); | 60 | unsigned int len); |
46 | extern void *trace_seq_reserve(struct trace_seq *s, size_t len); | ||
47 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); | 61 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); |
48 | 62 | ||
49 | extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, | 63 | extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, |
@@ -71,8 +85,8 @@ static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) | |||
71 | { | 85 | { |
72 | return 0; | 86 | return 0; |
73 | } | 87 | } |
74 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 88 | static inline int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
75 | size_t cnt) | 89 | int cnt) |
76 | { | 90 | { |
77 | return 0; | 91 | return 0; |
78 | } | 92 | } |
@@ -85,19 +99,15 @@ static inline int trace_seq_putc(struct trace_seq *s, unsigned char c) | |||
85 | return 0; | 99 | return 0; |
86 | } | 100 | } |
87 | static inline int | 101 | static inline int |
88 | trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len) | 102 | trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) |
89 | { | 103 | { |
90 | return 0; | 104 | return 0; |
91 | } | 105 | } |
92 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 106 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
93 | size_t len) | 107 | unsigned int len) |
94 | { | 108 | { |
95 | return 0; | 109 | return 0; |
96 | } | 110 | } |
97 | static inline void *trace_seq_reserve(struct trace_seq *s, size_t len) | ||
98 | { | ||
99 | return NULL; | ||
100 | } | ||
101 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) | 111 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) |
102 | { | 112 | { |
103 | return 0; | 113 | return 0; |