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