How to write marker info in MMIO trace from kernel

Previous thread: Re: virtio: put last_used and last_avail index into ring itself. by Michael S. Tsirkin on Tuesday, May 4, 2010 - 11:22 am. (6 messages)

Next thread: [PATCH 1/2] resources: fill in type for __request_region() by Bjorn Helgaas on Tuesday, May 4, 2010 - 11:58 am. (7 messages)
From: Larry Finger
Date: Tuesday, May 4, 2010 - 11:36 am

Stephen,

I hope you are the correct person for this question.

I would like to write information into the MMIO trace file similar to
what the user space write to /sys/.../trace_marker would accomplish,
however, I want to do it in place of printk statements in the driver I'm
tracing. Do you have any suggestions on how to do this? I have tools to
merge the trace dump with dmesg output, but the latter lags behind and I
do not get good correlation.

Thanks,

Larry
--

From: Steven Rostedt
Date: Tuesday, May 4, 2010 - 11:42 am

You can use "trace_printk()". I think that is what you are looking for.

-- Steve


--

From: Larry Finger
Date: Tuesday, May 4, 2010 - 3:27 pm

Thanks for the info. One other question - when I write only mmiotrace to
the current_tracer, the trace_printk() stuff does not end up in the
buffer. I can get it by using the "sysprof" tracer, but that has a lot
of stuff I do not want. Did I miss some configuration? My list of
available tracers is "blk kmemtrace mmiotrace wakeup_rt wakeup function
sysprof sched_switch nop".

Thanks,

Larry
--

From: Steven Rostedt
Date: Tuesday, May 4, 2010 - 3:58 pm

Ug, that's because the mmiotrace handles its own prints and ignores
anything it does not know about. Here, try this patch:

-- Steve

diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index 017fa37..8652f28 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -282,7 +282,7 @@ static enum print_line_t mmio_print_line(struct trace_iterator *iter)
 	case TRACE_PRINT:
 		return mmio_print_mark(iter);
 	default:
-		return TRACE_TYPE_HANDLED; /* ignore unknown entries */
+		return TRACE_TYPE_UNHANDLED;
 	}
 }
 


--

From: Larry Finger
Date: Tuesday, May 4, 2010 - 5:33 pm

That did the trick.

Thanks a lot,

Larry
--

Previous thread: Re: virtio: put last_used and last_avail index into ring itself. by Michael S. Tsirkin on Tuesday, May 4, 2010 - 11:22 am. (6 messages)

Next thread: [PATCH 1/2] resources: fill in type for __request_region() by Bjorn Helgaas on Tuesday, May 4, 2010 - 11:58 am. (7 messages)