Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_TRACE_H
0003 #define _LINUX_TRACE_H
0004 
0005 #ifdef CONFIG_TRACING
0006 
0007 #define TRACE_EXPORT_FUNCTION   BIT(0)
0008 #define TRACE_EXPORT_EVENT  BIT(1)
0009 #define TRACE_EXPORT_MARKER BIT(2)
0010 
0011 /*
0012  * The trace export - an export of Ftrace output. The trace_export
0013  * can process traces and export them to a registered destination as
0014  * an addition to the current only output of Ftrace - i.e. ring buffer.
0015  *
0016  * If you want traces to be sent to some other place rather than ring
0017  * buffer only, just need to register a new trace_export and implement
0018  * its own .write() function for writing traces to the storage.
0019  *
0020  * next     - pointer to the next trace_export
0021  * write    - copy traces which have been delt with ->commit() to
0022  *        the destination
0023  * flags    - which ftrace to be exported
0024  */
0025 struct trace_export {
0026     struct trace_export __rcu   *next;
0027     void (*write)(struct trace_export *, const void *, unsigned int);
0028     int flags;
0029 };
0030 
0031 int register_ftrace_export(struct trace_export *export);
0032 int unregister_ftrace_export(struct trace_export *export);
0033 
0034 struct trace_array;
0035 
0036 void trace_printk_init_buffers(void);
0037 __printf(3, 4)
0038 int trace_array_printk(struct trace_array *tr, unsigned long ip,
0039                const char *fmt, ...);
0040 int trace_array_init_printk(struct trace_array *tr);
0041 void trace_array_put(struct trace_array *tr);
0042 struct trace_array *trace_array_get_by_name(const char *name);
0043 int trace_array_destroy(struct trace_array *tr);
0044 
0045 /* For osnoise tracer */
0046 int osnoise_arch_register(void);
0047 void osnoise_arch_unregister(void);
0048 void osnoise_trace_irq_entry(int id);
0049 void osnoise_trace_irq_exit(int id, const char *desc);
0050 
0051 #endif  /* CONFIG_TRACING */
0052 
0053 #endif  /* _LINUX_TRACE_H */