浏览代码

trace: add gcc printf check to trace_seq_printf

Andrew Morton suggested adding a printf checker to trace_seq_printf
since there are a number of users that have improper format arguments.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Steven Rostedt 16 年之前
父节点
当前提交
c37abc5515
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      kernel/trace/trace_output.h

+ 2 - 1
kernel/trace/trace_output.h

@@ -16,7 +16,8 @@ struct trace_event {
 	trace_print_func	binary;
 	trace_print_func	binary;
 };
 };
 
 
-extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
+extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
+	__attribute__ ((format (printf, 2, 3)));
 extern int
 extern int
 seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
 seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
 		unsigned long sym_flags);
 		unsigned long sym_flags);