aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/mmio-mod.c
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2008-09-16 15:00:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:37:11 -0400
commit9e57fb35d711331a9b1410c5c56ebeb3733428a0 (patch)
tree2e68b1b8bb233378cbcad0c8e9bc8f99abf7263a /arch/x86/mm/mmio-mod.c
parent801fe40001dfc263848552fb28924b766ed44ea4 (diff)
x86 mmiotrace: implement mmiotrace_printk()
Offer mmiotrace users a function to inject markers from inside the kernel. This depends on the trace_vprintk() patch. 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 'arch/x86/mm/mmio-mod.c')
-rw-r--r--arch/x86/mm/mmio-mod.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
index 754bd1eaf4f6..5e2e2e72ee80 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
@@ -75,7 +75,7 @@ static LIST_HEAD(trace_list); /* struct remap_trace */
75 * and trace_lock. 75 * and trace_lock.
76 * - Routines depending on is_enabled() must take trace_lock. 76 * - Routines depending on is_enabled() must take trace_lock.
77 * - trace_list users must hold trace_lock. 77 * - trace_list users must hold trace_lock.
78 * - is_enabled() guarantees that mmio_trace_record is allowed. 78 * - is_enabled() guarantees that mmio_trace_{rw,mapping} are allowed.
79 * - pre/post callbacks assume the effect of is_enabled() being true. 79 * - pre/post callbacks assume the effect of is_enabled() being true.
80 */ 80 */
81 81
@@ -379,6 +379,23 @@ void mmiotrace_iounmap(volatile void __iomem *addr)
379 iounmap_trace_core(addr); 379 iounmap_trace_core(addr);
380} 380}
381 381
382int mmiotrace_printk(const char *fmt, ...)
383{
384 int ret = 0;
385 va_list args;
386 unsigned long flags;
387 va_start(args, fmt);
388
389 spin_lock_irqsave(&trace_lock, flags);
390 if (is_enabled())
391 ret = mmio_trace_printk(fmt, args);
392 spin_unlock_irqrestore(&trace_lock, flags);
393
394 va_end(args);
395 return ret;
396}
397EXPORT_SYMBOL(mmiotrace_printk);
398
382static void clear_trace_list(void) 399static void clear_trace_list(void)
383{ 400{
384 struct remap_trace *trace; 401 struct remap_trace *trace;