]> git.hungrycats.org Git - linux/commitdiff
tracing: Add TRACE_ITER_PRINTK flag check in __trace_puts/__trace_bputs
authorzhangwei(Jovi) <jovi.zhangwei@huawei.com>
Thu, 18 Jul 2013 08:31:18 +0000 (16:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Jul 2014 15:08:20 +0000 (08:08 -0700)
commit f0160a5a2912267c02cfe692eac955c360de5fdf upstream.

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.8090900@huawei.com
Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c

index 4c32d8e6f24655220d07f6d124ee37773e86d7e9..4dcbf7dc3c510b9b6aea49ccdc08fac9e9d48c03 100644 (file)
@@ -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))