From: Jan Kiszka <jan.kis...@siemens.com>

We depend on hard-irqs being disabled to push trace_printk
data safely to ftrace.

Signed-off-by: Wolfgang Mauerer <wolfgang.maue...@siemens.com>
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 kernel/trace/trace.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a7fa070..a85936f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1592,8 +1592,9 @@ int trace_vbprintk(unsigned long ip, const char *fmt, 
va_list args)
        /* Don't pollute graph traces with trace_vprintk internals */
        pause_graph_tracing();
 
+       flags = hard_local_irq_save();
+
        pc = preempt_count();
-       preempt_disable_notrace();
 
        tbuffer = get_trace_buf();
        if (!tbuffer) {
@@ -1606,7 +1607,6 @@ int trace_vbprintk(unsigned long ip, const char *fmt, 
va_list args)
        if (len > TRACE_BUF_SIZE/sizeof(int) || len < 0)
                goto out;
 
-       local_save_flags(flags);
        size = sizeof(*entry) + sizeof(u32) * len;
        buffer = tr->buffer;
        event = trace_buffer_lock_reserve(buffer, TRACE_BPRINT, size,
@@ -1624,7 +1624,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, 
va_list args)
        }
 
 out:
-       preempt_enable_notrace();
+       hard_local_irq_restore(flags);
        unpause_graph_tracing();
 
        return len;
-- 
1.7.1


_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to