blob: 7fd86d3c691f55a19087f6eb675cae37788b02a5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Chunyan Zhang478409d2016-11-21 15:57:18 +08002#ifndef _LINUX_TRACE_H
3#define _LINUX_TRACE_H
4
5#ifdef CONFIG_TRACING
6/*
7 * The trace export - an export of Ftrace output. The trace_export
8 * can process traces and export them to a registered destination as
9 * an addition to the current only output of Ftrace - i.e. ring buffer.
10 *
11 * If you want traces to be sent to some other place rather than ring
12 * buffer only, just need to register a new trace_export and implement
13 * its own .write() function for writing traces to the storage.
14 *
15 * next - pointer to the next trace_export
16 * write - copy traces which have been delt with ->commit() to
17 * the destination
18 */
19struct trace_export {
20 struct trace_export __rcu *next;
Felipe Balbia773d412017-06-02 13:20:25 +030021 void (*write)(struct trace_export *, const void *, unsigned int);
Chunyan Zhang478409d2016-11-21 15:57:18 +080022};
23
24int register_ftrace_export(struct trace_export *export);
25int unregister_ftrace_export(struct trace_export *export);
26
Divya Indi2d6425a2019-08-14 10:55:23 -070027struct trace_array;
28
29void trace_printk_init_buffers(void);
30int trace_array_printk(struct trace_array *tr, unsigned long ip,
31 const char *fmt, ...);
Divya Indi28879782019-11-20 11:08:38 -080032void trace_array_put(struct trace_array *tr);
33struct trace_array *trace_array_get_by_name(const char *name);
Divya Indi2d6425a2019-08-14 10:55:23 -070034int trace_array_destroy(struct trace_array *tr);
Chunyan Zhang478409d2016-11-21 15:57:18 +080035#endif /* CONFIG_TRACING */
36
37#endif /* _LINUX_TRACE_H */