Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
478409dd CZ |
2 | #ifndef _LINUX_TRACE_H |
3 | #define _LINUX_TRACE_H | |
4 | ||
5 | #ifdef CONFIG_TRACING | |
8438f521 TZ |
6 | |
7 | #define TRACE_EXPORT_FUNCTION BIT(0) | |
8ab7a2b7 | 8 | #define TRACE_EXPORT_EVENT BIT(1) |
458999c6 | 9 | #define TRACE_EXPORT_MARKER BIT(2) |
8438f521 | 10 | |
478409dd CZ |
11 | /* |
12 | * The trace export - an export of Ftrace output. The trace_export | |
13 | * can process traces and export them to a registered destination as | |
14 | * an addition to the current only output of Ftrace - i.e. ring buffer. | |
15 | * | |
16 | * If you want traces to be sent to some other place rather than ring | |
17 | * buffer only, just need to register a new trace_export and implement | |
18 | * its own .write() function for writing traces to the storage. | |
19 | * | |
20 | * next - pointer to the next trace_export | |
21 | * write - copy traces which have been delt with ->commit() to | |
22 | * the destination | |
8438f521 | 23 | * flags - which ftrace to be exported |
478409dd CZ |
24 | */ |
25 | struct trace_export { | |
26 | struct trace_export __rcu *next; | |
a773d419 | 27 | void (*write)(struct trace_export *, const void *, unsigned int); |
8438f521 | 28 | int flags; |
478409dd CZ |
29 | }; |
30 | ||
31 | int register_ftrace_export(struct trace_export *export); | |
32 | int unregister_ftrace_export(struct trace_export *export); | |
33 | ||
2d6425af DI |
34 | struct trace_array; |
35 | ||
36 | void trace_printk_init_buffers(void); | |
bd0c9706 | 37 | __printf(3, 4) |
2d6425af | 38 | int trace_array_printk(struct trace_array *tr, unsigned long ip, |
bd0c9706 | 39 | const char *fmt, ...); |
38ce2a9e | 40 | int trace_array_init_printk(struct trace_array *tr); |
28879787 DI |
41 | void trace_array_put(struct trace_array *tr); |
42 | struct trace_array *trace_array_get_by_name(const char *name); | |
2d6425af | 43 | int trace_array_destroy(struct trace_array *tr); |
bce29ac9 DBO |
44 | |
45 | /* For osnoise tracer */ | |
46 | int osnoise_arch_register(void); | |
47 | void osnoise_arch_unregister(void); | |
48 | ||
478409dd CZ |
49 | #endif /* CONFIG_TRACING */ |
50 | ||
51 | #endif /* _LINUX_TRACE_H */ |