trace.h 964 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_TRACE_H
  3. #define _LINUX_TRACE_H
  4. #ifdef CONFIG_TRACING
  5. /*
  6. * The trace export - an export of Ftrace output. The trace_export
  7. * can process traces and export them to a registered destination as
  8. * an addition to the current only output of Ftrace - i.e. ring buffer.
  9. *
  10. * If you want traces to be sent to some other place rather than ring
  11. * buffer only, just need to register a new trace_export and implement
  12. * its own .write() function for writing traces to the storage.
  13. *
  14. * next - pointer to the next trace_export
  15. * write - copy traces which have been delt with ->commit() to
  16. * the destination
  17. */
  18. struct trace_export {
  19. struct trace_export __rcu *next;
  20. void (*write)(struct trace_export *, const void *, unsigned int);
  21. };
  22. int register_ftrace_export(struct trace_export *export);
  23. int unregister_ftrace_export(struct trace_export *export);
  24. #endif /* CONFIG_TRACING */
  25. #endif /* _LINUX_TRACE_H */