forked from projectara/greybus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greybus_trace.h
170 lines (130 loc) · 3.95 KB
/
greybus_trace.h
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
* Greybus driver and device API
*
* Copyright 2015 Google Inc.
* Copyright 2015 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM greybus
#if !defined(_TRACE_GREYBUS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_GREYBUS_H
#include <linux/tracepoint.h>
struct gb_message;
struct greybus_host_device;
DECLARE_EVENT_CLASS(gb_message,
TP_PROTO(struct gb_message *message),
TP_ARGS(message),
TP_STRUCT__entry(
__string(name, dev_name(&message->operation->connection->dev))
__field(u16, op_id)
__field(u16, intf_cport_id)
__field(u16, hd_cport_id)
__field(size_t, payload_size)
),
TP_fast_assign(
__assign_str(name, dev_name(&message->operation->connection->dev))
__entry->op_id = message->operation->id;
__entry->intf_cport_id =
message->operation->connection->intf_cport_id;
__entry->hd_cport_id =
message->operation->connection->hd_cport_id;
__entry->payload_size = message->payload_size;
),
TP_printk("greybus:%s op=%04x if_id=%04x hd_id=%04x l=%zu",
__get_str(name), __entry->op_id, __entry->intf_cport_id,
__entry->hd_cport_id, __entry->payload_size)
);
/*
* tracepoint name greybus:gb_message_send
* description send a greybus message
* location operation.c:gb_message_send
*/
DEFINE_EVENT(gb_message, gb_message_send,
TP_PROTO(struct gb_message *message),
TP_ARGS(message)
);
/*
* tracepoint name greybus:gb_message_recv_request
* description receive a greybus request
* location operation.c:gb_connection_recv_request
*/
DEFINE_EVENT(gb_message, gb_message_recv_request,
TP_PROTO(struct gb_message *message),
TP_ARGS(message)
);
/*
* tracepoint name greybus:gb_message_recv_response
* description receive a greybus response
* location operation.c:gb_connection_recv_response
*/
DEFINE_EVENT(gb_message, gb_message_recv_response,
TP_PROTO(struct gb_message *message),
TP_ARGS(message)
);
/*
* tracepoint name greybus:gb_message_cancel_outgoing
* description cancel outgoing greybus request
* location operation.c:gb_message_cancel
*/
DEFINE_EVENT(gb_message, gb_message_cancel_outgoing,
TP_PROTO(struct gb_message *message),
TP_ARGS(message)
);
/*
* tracepoint name greybus:gb_message_cancel_incoming
* description cancel incoming greybus request
* location operation.c:gb_message_cancel_incoming
*/
DEFINE_EVENT(gb_message, gb_message_cancel_incoming,
TP_PROTO(struct gb_message *message),
TP_ARGS(message)
);
DECLARE_EVENT_CLASS(gb_host_device,
TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id,
size_t payload_size),
TP_ARGS(hd, intf_cport_id, payload_size),
TP_STRUCT__entry(
__string(name, dev_name(hd->parent))
__field(u16, intf_cport_id)
__field(size_t, payload_size)
),
TP_fast_assign(
__assign_str(name, dev_name(hd->parent))
__entry->intf_cport_id = intf_cport_id;
__entry->payload_size = payload_size;
),
TP_printk("greybus:%s if_id=%04x l=%zu", __get_str(name),
__entry->intf_cport_id, __entry->payload_size)
);
/*
* tracepoint name greybus:gb_host_device_send
* description tracepoint representing the point data are transmitted
* location es1.c/es2.c:message_send
*/
DEFINE_EVENT(gb_host_device, gb_host_device_send,
TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id,
size_t payload_size),
TP_ARGS(hd, intf_cport_id, payload_size)
);
/*
* tracepoint name greybus:gb_host_device_recv
* description tracepoint representing the point data are received
* location es1.c/es2.c:cport_in_callback
*/
DEFINE_EVENT(gb_host_device, gb_host_device_recv,
TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id,
size_t payload_size),
TP_ARGS(hd, intf_cport_id, payload_size)
);
#endif /* _TRACE_GREYBUS_H */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
/*
* TRACE_INCLUDE_FILE is not needed if the filename and TRACE_SYSTEM are equal
*/
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE greybus_trace
#include <trace/define_trace.h>