aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_mmiotrace.c
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2008-09-16 15:02:27 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:37:14 -0400
commitfc5e27ae4b45a0619701a83f30d9b7fad7ed9400 (patch)
tree236b53e76430aae9f6b1abc37de9259ba95c38c6 /kernel/trace/trace_mmiotrace.c
parent9e57fb35d711331a9b1410c5c56ebeb3733428a0 (diff)
mmiotrace: handle TRACE_PRINT entries
Also make trace_seq_print_cont() non-static, and add a newline if the seq buffer can't hold all data. Signed-off-by: Pekka Paalanen <pq@iki.fi> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_mmiotrace.c')
-rw-r--r--kernel/trace/trace_mmiotrace.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index 767d1faf56e5..a108c326f36e 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -245,6 +245,27 @@ static int mmio_print_map(struct trace_iterator *iter)
245 return 0; 245 return 0;
246} 246}
247 247
248static int mmio_print_mark(struct trace_iterator *iter)
249{
250 struct trace_entry *entry = iter->ent;
251 const char *msg = entry->field.print.buf;
252 struct trace_seq *s = &iter->seq;
253 unsigned long long t = ns2usecs(entry->field.t);
254 unsigned long usec_rem = do_div(t, 1000000ULL);
255 unsigned secs = (unsigned long)t;
256 int ret;
257
258 /* The trailing newline must be in the message. */
259 ret = trace_seq_printf(s, "MARK %lu.%06lu %s", secs, usec_rem, msg);
260 if (!ret)
261 return 0;
262
263 if (entry->field.flags & TRACE_FLAG_CONT)
264 trace_seq_print_cont(s, iter);
265
266 return 1;
267}
268
248/* return 0 to abort printing without consuming current entry in pipe mode */ 269/* return 0 to abort printing without consuming current entry in pipe mode */
249static int mmio_print_line(struct trace_iterator *iter) 270static int mmio_print_line(struct trace_iterator *iter)
250{ 271{
@@ -253,6 +274,8 @@ static int mmio_print_line(struct trace_iterator *iter)
253 return mmio_print_rw(iter); 274 return mmio_print_rw(iter);
254 case TRACE_MMIO_MAP: 275 case TRACE_MMIO_MAP:
255 return mmio_print_map(iter); 276 return mmio_print_map(iter);
277 case TRACE_PRINT:
278 return mmio_print_mark(iter);
256 default: 279 default:
257 return 1; /* ignore unknown entries */ 280 return 1; /* ignore unknown entries */
258 } 281 }