Skip to contentSkip to conversation

tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers

PATCH New Steven Rostedt 1 participant 1 message Aug 7, 2020 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers

Hopefully the last patch for this merge window pull request.

-- Steve

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: 38ce2a9e33db61a3041840310077072d6210ead4

Steven Rostedt (VMware) (1):
tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers

----

 include/linux/trace.h |  1 +
 kernel/trace/trace.c  | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
---------------------------
commit 38ce2a9e33db61a3041840310077072d6210ead4
Author: Steven Rostedt (VMware) <[email protected]>
Date:   Thu Aug 6 12:46:49 2020 -0400

tracing: Add trace_array_init_printk() to initialize instance trace_printk() buffers

As trace_array_printk() used with not global instances will not add noise to the main buffer, they are OK to have in the kernel (unlike trace_printk()). This require the subsystem to create their own tracing instance, and the trace_array_printk() only writes into those instances.

Add trace_array_init_printk() to initialize the trace_printk() buffers without printing out the WARNING message.

include/linux/trace.h +1 -0
index 7fd86d3c691f..36d255d66f88 100644
@@ -29,6 +29,7 @@ struct trace_array;
 void trace_printk_init_buffers(void);
 int trace_array_printk(struct trace_array *tr, unsigned long ip,
 		const char *fmt, ...);
+int trace_array_init_printk(struct trace_array *tr);
 void trace_array_put(struct trace_array *tr);
 struct trace_array *trace_array_get_by_name(const char *name);
 int trace_array_destroy(struct trace_array *tr);
kernel/trace/trace.c +44 -0

62 lines not on this page · raw message