From: "zhangwei(Jovi)" <jovi.zhang...@huawei.com>

The TRACE_ITER_PRINTK check in __trace_puts/__trace_bputs is missing,
so add it, to be consistent with __trace_printk/__trace_bprintk.
Those functions are all called by the same function: trace_printk().

Link: http://lkml.kernel.org/p/51e7a7d6.8090...@huawei.com

Cc: sta...@vger.kernel.org # 3.11+
Signed-off-by: zhangwei(Jovi) <jovi.zhang...@huawei.com>
Signed-off-by: Steven Rostedt <rost...@goodmis.org>
---
 kernel/trace/trace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a6ffc8918dda..bda9621638cc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -468,6 +468,9 @@ int __trace_puts(unsigned long ip, const char *str, int 
size)
        int alloc;
        int pc;
 
+       if (!(trace_flags & TRACE_ITER_PRINTK))
+               return 0;
+
        pc = preempt_count();
 
        if (unlikely(tracing_selftest_running || tracing_disabled))
@@ -515,6 +518,9 @@ int __trace_bputs(unsigned long ip, const char *str)
        int size = sizeof(struct bputs_entry);
        int pc;
 
+       if (!(trace_flags & TRACE_ITER_PRINTK))
+               return 0;
+
        pc = preempt_count();
 
        if (unlikely(tracing_selftest_running || tracing_disabled))
-- 
2.0.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to