sync.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM sync
  3. #if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_SYNC_H
  5. #include <linux/sync.h>
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT(sync_timeline,
  8. TP_PROTO(struct sync_timeline *timeline),
  9. TP_ARGS(timeline),
  10. TP_STRUCT__entry(
  11. __string(name, timeline->name)
  12. __array(char, value, 32)
  13. ),
  14. TP_fast_assign(
  15. __assign_str(name, timeline->name);
  16. if (timeline->ops->timeline_value_str) {
  17. timeline->ops->timeline_value_str(timeline,
  18. __entry->value,
  19. sizeof(__entry->value));
  20. } else {
  21. __entry->value[0] = '\0';
  22. }
  23. ),
  24. TP_printk("name=%s value=%s", __get_str(name), __entry->value)
  25. );
  26. TRACE_EVENT(sync_wait,
  27. TP_PROTO(struct sync_fence *fence, int begin),
  28. TP_ARGS(fence, begin),
  29. TP_STRUCT__entry(
  30. __string(name, fence->name)
  31. __field(s32, status)
  32. __field(u32, begin)
  33. ),
  34. TP_fast_assign(
  35. __assign_str(name, fence->name);
  36. __entry->status = fence->status;
  37. __entry->begin = begin;
  38. ),
  39. TP_printk("%s name=%s state=%d", __entry->begin ? "begin" : "end",
  40. __get_str(name), __entry->status)
  41. );
  42. TRACE_EVENT(sync_pt,
  43. TP_PROTO(struct sync_pt *pt),
  44. TP_ARGS(pt),
  45. TP_STRUCT__entry(
  46. __string(timeline, pt->parent->name)
  47. __array(char, value, 32)
  48. ),
  49. TP_fast_assign(
  50. __assign_str(timeline, pt->parent->name);
  51. if (pt->parent->ops->pt_value_str) {
  52. pt->parent->ops->pt_value_str(pt,
  53. __entry->value,
  54. sizeof(__entry->value));
  55. } else {
  56. __entry->value[0] = '\0';
  57. }
  58. ),
  59. TP_printk("name=%s value=%s", __get_str(timeline), __entry->value)
  60. );
  61. #endif /* if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) */
  62. /* This part must be outside protection */
  63. #include <trace/define_trace.h>