bpf_test_run.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM bpf_test_run
  4. #if !defined(_TRACE_BPF_TEST_RUN_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_BPF_TEST_RUN_H
  6. #include <linux/tracepoint.h>
  7. DECLARE_EVENT_CLASS(bpf_test_finish,
  8. TP_PROTO(int *err),
  9. TP_ARGS(err),
  10. TP_STRUCT__entry(
  11. __field(int, err)
  12. ),
  13. TP_fast_assign(
  14. __entry->err = *err;
  15. ),
  16. TP_printk("bpf_test_finish with err=%d", __entry->err)
  17. );
  18. #ifdef DEFINE_EVENT_WRITABLE
  19. #undef BPF_TEST_RUN_DEFINE_EVENT
  20. #define BPF_TEST_RUN_DEFINE_EVENT(template, call, proto, args, size) \
  21. DEFINE_EVENT_WRITABLE(template, call, PARAMS(proto), \
  22. PARAMS(args), size)
  23. #else
  24. #undef BPF_TEST_RUN_DEFINE_EVENT
  25. #define BPF_TEST_RUN_DEFINE_EVENT(template, call, proto, args, size) \
  26. DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args))
  27. #endif
  28. BPF_TEST_RUN_DEFINE_EVENT(bpf_test_finish, bpf_test_finish,
  29. TP_PROTO(int *err),
  30. TP_ARGS(err),
  31. sizeof(int)
  32. );
  33. #endif
  34. /* This part must be outside protection */
  35. #include <trace/define_trace.h>