diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-09-29 14:27:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:39:02 -0400 |
commit | 07f4e4f790895d55f46aaf89e7437da4a585989c (patch) | |
tree | c2b6cecb4f27e572c3a325f1c1d868cbcc0e6099 /kernel/trace/trace_mmiotrace.c | |
parent | 9ff4b9744c187cae58c3774361ea090addbc4130 (diff) |
tracing/ftrace: adapt mmiotrace to the new type of print_line
Adapt mmiotrace to the new print_line type.
By default, it ignores (and consumes) types it doesn't support.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_mmiotrace.c')
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index 3df441ea2749..1a266aa08e1a 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -175,7 +175,7 @@ print_out: | |||
175 | return (ret == -EBUSY) ? 0 : ret; | 175 | return (ret == -EBUSY) ? 0 : ret; |
176 | } | 176 | } |
177 | 177 | ||
178 | static int mmio_print_rw(struct trace_iterator *iter) | 178 | static enum print_line_t mmio_print_rw(struct trace_iterator *iter) |
179 | { | 179 | { |
180 | struct trace_entry *entry = iter->ent; | 180 | struct trace_entry *entry = iter->ent; |
181 | struct trace_mmiotrace_rw *field = | 181 | struct trace_mmiotrace_rw *field = |
@@ -215,11 +215,11 @@ static int mmio_print_rw(struct trace_iterator *iter) | |||
215 | break; | 215 | break; |
216 | } | 216 | } |
217 | if (ret) | 217 | if (ret) |
218 | return 1; | 218 | return TRACE_TYPE_HANDLED; |
219 | return 0; | 219 | return TRACE_TYPE_PARTIAL_LINE; |
220 | } | 220 | } |
221 | 221 | ||
222 | static int mmio_print_map(struct trace_iterator *iter) | 222 | static enum print_line_t mmio_print_map(struct trace_iterator *iter) |
223 | { | 223 | { |
224 | struct trace_entry *entry = iter->ent; | 224 | struct trace_entry *entry = iter->ent; |
225 | struct mmiotrace_map *m = (struct mmiotrace_map *)entry; | 225 | struct mmiotrace_map *m = (struct mmiotrace_map *)entry; |
@@ -227,7 +227,7 @@ static int mmio_print_map(struct trace_iterator *iter) | |||
227 | unsigned long long t = ns2usecs(iter->ts); | 227 | unsigned long long t = ns2usecs(iter->ts); |
228 | unsigned long usec_rem = do_div(t, 1000000ULL); | 228 | unsigned long usec_rem = do_div(t, 1000000ULL); |
229 | unsigned secs = (unsigned long)t; | 229 | unsigned secs = (unsigned long)t; |
230 | int ret = 1; | 230 | int ret; |
231 | 231 | ||
232 | switch (m->opcode) { | 232 | switch (m->opcode) { |
233 | case MMIO_PROBE: | 233 | case MMIO_PROBE: |
@@ -247,11 +247,11 @@ static int mmio_print_map(struct trace_iterator *iter) | |||
247 | break; | 247 | break; |
248 | } | 248 | } |
249 | if (ret) | 249 | if (ret) |
250 | return 1; | 250 | return TRACE_TYPE_HANDLED; |
251 | return 0; | 251 | return TRACE_TYPE_PARTIAL_LINE; |
252 | } | 252 | } |
253 | 253 | ||
254 | static int mmio_print_mark(struct trace_iterator *iter) | 254 | static enum print_line_t mmio_print_mark(struct trace_iterator *iter) |
255 | { | 255 | { |
256 | struct trace_entry *entry = iter->ent; | 256 | struct trace_entry *entry = iter->ent; |
257 | struct print_entry *print = (struct print_entry *)entry; | 257 | struct print_entry *print = (struct print_entry *)entry; |
@@ -265,16 +265,15 @@ static int mmio_print_mark(struct trace_iterator *iter) | |||
265 | /* The trailing newline must be in the message. */ | 265 | /* The trailing newline must be in the message. */ |
266 | ret = trace_seq_printf(s, "MARK %lu.%06lu %s", secs, usec_rem, msg); | 266 | ret = trace_seq_printf(s, "MARK %lu.%06lu %s", secs, usec_rem, msg); |
267 | if (!ret) | 267 | if (!ret) |
268 | return 0; | 268 | return TRACE_TYPE_PARTIAL_LINE; |
269 | 269 | ||
270 | if (entry->flags & TRACE_FLAG_CONT) | 270 | if (entry->flags & TRACE_FLAG_CONT) |
271 | trace_seq_print_cont(s, iter); | 271 | trace_seq_print_cont(s, iter); |
272 | 272 | ||
273 | return 1; | 273 | return TRACE_TYPE_HANDLED; |
274 | } | 274 | } |
275 | 275 | ||
276 | /* return 0 to abort printing without consuming current entry in pipe mode */ | 276 | static enum print_line_t mmio_print_line(struct trace_iterator *iter) |
277 | static int mmio_print_line(struct trace_iterator *iter) | ||
278 | { | 277 | { |
279 | switch (iter->ent->type) { | 278 | switch (iter->ent->type) { |
280 | case TRACE_MMIO_RW: | 279 | case TRACE_MMIO_RW: |
@@ -284,7 +283,7 @@ static int mmio_print_line(struct trace_iterator *iter) | |||
284 | case TRACE_PRINT: | 283 | case TRACE_PRINT: |
285 | return mmio_print_mark(iter); | 284 | return mmio_print_mark(iter); |
286 | default: | 285 | default: |
287 | return 1; /* ignore unknown entries */ | 286 | return TRACE_TYPE_HANDLED; /* ignore unknown entries */ |
288 | } | 287 | } |
289 | } | 288 | } |
290 | 289 | ||