Skip to contentSkip to conversation

tracing: add TRACE_ITER_PRINTK flag check in __trace_puts/__trace_bputs

PATCH In review zhangwei(Jovi) 2 participants 2 messages Jul 18, 2013 – Jul 9, 2014 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 tracing: add TRACE_ITER_PRINTK flag check in __trace_puts/__trace_bputs

There missed TRACE_ITER_PRINTK check in __trace_puts/__trace_bputs, so add it, to constant with __trace_printk/__trace_bprintk, those functions mainly called by same function: trace_printk.

---
 kernel/trace/trace.c |    6 ++++++
 1 file changed, 6 insertions(+)
kernel/trace/trace.c +6 -0
index 4d70cc5..41340c3 100644
@@ -365,6 +365,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();
 
 	alloc = sizeof(*entry) + size + 2; /* possible \n added */
@@ -409,6 +412,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();
 
 	local_save_flags(irq_flags);
Signature · 1 line
1.7.9.7
maintainer
#1 lore raw
Quoted 3 lines · On Thu, 18 Jul 2013 16:31:18 +0800 "zhangwei(Jovi)" <[email protected]>…

There missed TRACE_ITER_PRINTK check in __trace_puts/__trace_bputs, so add it, to constant with __trace_printk/__trace_bprintk, those functions mainly called by same function: trace_printk.

Looks good, I'll add this to my 3.17 queue too.

-- Steve

Quoted 30 lines
---
 kernel/trace/trace.c |    6 ++++++
 1 file changed, 6 insertions(+)
kernel/trace/trace.c +6 -0
index 4d70cc5..41340c3 100644
@@ -365,6 +365,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();
 
 	alloc = sizeof(*entry) + size + 2; /* possible \n added */
@@ -409,6 +412,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();
 
 	local_save_flags(irq_flags);