diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 19261fdd2455..d72b9a63b247 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -137,7 +137,7 @@ int trace_seq_putc(struct trace_seq *s, unsigned char c) | |||
137 | return 1; | 137 | return 1; |
138 | } | 138 | } |
139 | 139 | ||
140 | int trace_seq_putmem(struct trace_seq *s, void *mem, size_t len) | 140 | int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len) |
141 | { | 141 | { |
142 | if (len > ((PAGE_SIZE - 1) - s->len)) | 142 | if (len > ((PAGE_SIZE - 1) - s->len)) |
143 | return 0; | 143 | return 0; |
@@ -148,10 +148,10 @@ int trace_seq_putmem(struct trace_seq *s, void *mem, size_t len) | |||
148 | return len; | 148 | return len; |
149 | } | 149 | } |
150 | 150 | ||
151 | int trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | 151 | int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, size_t len) |
152 | { | 152 | { |
153 | unsigned char hex[HEX_CHARS]; | 153 | unsigned char hex[HEX_CHARS]; |
154 | unsigned char *data = mem; | 154 | const unsigned char *data = mem; |
155 | int i, j; | 155 | int i, j; |
156 | 156 | ||
157 | #ifdef __BIG_ENDIAN | 157 | #ifdef __BIG_ENDIAN |
@@ -167,6 +167,19 @@ int trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len) | |||
167 | return trace_seq_putmem(s, hex, j); | 167 | return trace_seq_putmem(s, hex, j); |
168 | } | 168 | } |
169 | 169 | ||
170 | void *trace_seq_reserve(struct trace_seq *s, size_t len) | ||
171 | { | ||
172 | void *ret; | ||
173 | |||
174 | if (len > ((PAGE_SIZE - 1) - s->len)) | ||
175 | return NULL; | ||
176 | |||
177 | ret = s->buffer + s->len; | ||
178 | s->len += len; | ||
179 | |||
180 | return ret; | ||
181 | } | ||
182 | |||
170 | int trace_seq_path(struct trace_seq *s, struct path *path) | 183 | int trace_seq_path(struct trace_seq *s, struct path *path) |
171 | { | 184 | { |
172 | unsigned char *p; | 185 | unsigned char *p; |