mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
![Steven Rostedt (VMware)](/assets/img/avatar_default.png)
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. Reported-by: Sean Paul <sean@poorly.run> Reviewed-by: Sean Paul <sean@poorly.run> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_TRACE_H
|
|
#define _LINUX_TRACE_H
|
|
|
|
#ifdef CONFIG_TRACING
|
|
/*
|
|
* The trace export - an export of Ftrace output. The trace_export
|
|
* can process traces and export them to a registered destination as
|
|
* an addition to the current only output of Ftrace - i.e. ring buffer.
|
|
*
|
|
* If you want traces to be sent to some other place rather than ring
|
|
* buffer only, just need to register a new trace_export and implement
|
|
* its own .write() function for writing traces to the storage.
|
|
*
|
|
* next - pointer to the next trace_export
|
|
* write - copy traces which have been delt with ->commit() to
|
|
* the destination
|
|
*/
|
|
struct trace_export {
|
|
struct trace_export __rcu *next;
|
|
void (*write)(struct trace_export *, const void *, unsigned int);
|
|
};
|
|
|
|
int register_ftrace_export(struct trace_export *export);
|
|
int unregister_ftrace_export(struct trace_export *export);
|
|
|
|
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);
|
|
#endif /* CONFIG_TRACING */
|
|
|
|
#endif /* _LINUX_TRACE_H */
|