aboutsummaryrefslogtreecommitdiff
path: root/include/trace/events/sync.h
blob: f31bc63ca65d364796617d4ab1d2d26fd806b0a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#undef TRACE_SYSTEM
#define TRACE_SYSTEM sync

#if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SYNC_H

#include <linux/sync.h>
#include <linux/tracepoint.h>

TRACE_EVENT(sync_timeline,
	    TP_PROTO(struct sync_timeline *timeline),

	    TP_ARGS(timeline),

	    TP_STRUCT__entry(
		    __string(name, timeline->name)
		    __array(char, value, 32)
		    ),

	    TP_fast_assign(
		    __assign_str(name, timeline->name);
		    if (timeline->ops->timeline_value_str) {
			    timeline->ops->timeline_value_str(timeline,
							      __entry->value,
							      sizeof(__entry->value));
		    } else {
			    __entry->value[0] = '\0';
		    }
		    ),

	    TP_printk("name=%s value=%s", __get_str(name), __entry->value)
);

TRACE_EVENT(sync_wait,
	    TP_PROTO(struct sync_fence *fence, int begin),

	    TP_ARGS(fence, begin),

	    TP_STRUCT__entry(
		    __string(name, fence->name)
		    __field(s32, status)
		    __field(u32, begin)
		    ),

	    TP_fast_assign(
		    __assign_str(name, fence->name);
		    __entry->status = fence->status;
		    __entry->begin = begin;
		    ),

	    TP_printk("%s name=%s state=%d", __entry->begin ? "begin" : "end",
		      __get_str(name), __entry->status)
);

TRACE_EVENT(sync_pt,
	    TP_PROTO(struct sync_pt *pt),

	    TP_ARGS(pt),

	    TP_STRUCT__entry(
		    __string(timeline, pt->parent->name)
		    __array(char, value, 32)
		    ),

	    TP_fast_assign(
		    __assign_str(timeline, pt->parent->name);
		    if (pt->parent->ops->pt_value_str) {
			    pt->parent->ops->pt_value_str(pt,
							__entry->value,
							sizeof(__entry->value));
		    } else {
			    __entry->value[0] = '\0';
		    }
		    ),

	    TP_printk("name=%s value=%s", __get_str(timeline), __entry->value)
	);

#endif /* if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) */

/* This part must be outside protection */
#include <trace/define_trace.h>