Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Greybus driver and device API |
| 3 | * |
| 4 | * Copyright 2015 Google Inc. |
| 5 | * Copyright 2015 Linaro Ltd. |
| 6 | * |
| 7 | * Released under the GPLv2 only. |
| 8 | */ |
| 9 | #undef TRACE_SYSTEM |
| 10 | #define TRACE_SYSTEM greybus |
| 11 | |
| 12 | #if !defined(_TRACE_GREYBUS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 13 | #define _TRACE_GREYBUS_H |
| 14 | |
| 15 | #include <linux/tracepoint.h> |
| 16 | |
| 17 | struct gb_message; |
Johan Hovold | 2537636 | 2015-11-03 18:03:23 +0100 | [diff] [blame] | 18 | struct gb_host_device; |
Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 19 | |
| 20 | DECLARE_EVENT_CLASS(gb_message, |
| 21 | |
| 22 | TP_PROTO(struct gb_message *message), |
| 23 | |
| 24 | TP_ARGS(message), |
| 25 | |
| 26 | TP_STRUCT__entry( |
Greg Kroah-Hartman | 5d9c68d | 2015-10-16 16:55:29 -0700 | [diff] [blame] | 27 | __string(name, dev_name(&message->operation->connection->bundle->dev)) |
Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 28 | __field(u16, op_id) |
| 29 | __field(u16, intf_cport_id) |
| 30 | __field(u16, hd_cport_id) |
| 31 | __field(size_t, payload_size) |
| 32 | ), |
| 33 | |
| 34 | TP_fast_assign( |
Greg Kroah-Hartman | 5d9c68d | 2015-10-16 16:55:29 -0700 | [diff] [blame] | 35 | __assign_str(name, dev_name(&message->operation->connection->bundle->dev)) |
Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 36 | __entry->op_id = message->operation->id; |
| 37 | __entry->intf_cport_id = |
| 38 | message->operation->connection->intf_cport_id; |
| 39 | __entry->hd_cport_id = |
| 40 | message->operation->connection->hd_cport_id; |
| 41 | __entry->payload_size = message->payload_size; |
| 42 | ), |
| 43 | |
Johan Hovold | 100e900 | 2015-12-07 15:05:38 +0100 | [diff] [blame] | 44 | TP_printk("greybus:%s op=%04x if_id=%u hd_id=%u l=%zu", |
Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 45 | __get_str(name), __entry->op_id, __entry->intf_cport_id, |
| 46 | __entry->hd_cport_id, __entry->payload_size) |
| 47 | ); |
| 48 | |
| 49 | /* |
| 50 | * tracepoint name greybus:gb_message_send |
| 51 | * description send a greybus message |
| 52 | * location operation.c:gb_message_send |
| 53 | */ |
| 54 | DEFINE_EVENT(gb_message, gb_message_send, |
| 55 | |
| 56 | TP_PROTO(struct gb_message *message), |
| 57 | |
| 58 | TP_ARGS(message) |
| 59 | ); |
| 60 | |
| 61 | /* |
| 62 | * tracepoint name greybus:gb_message_recv_request |
| 63 | * description receive a greybus request |
| 64 | * location operation.c:gb_connection_recv_request |
| 65 | */ |
| 66 | DEFINE_EVENT(gb_message, gb_message_recv_request, |
| 67 | |
| 68 | TP_PROTO(struct gb_message *message), |
| 69 | |
| 70 | TP_ARGS(message) |
| 71 | ); |
| 72 | |
| 73 | /* |
| 74 | * tracepoint name greybus:gb_message_recv_response |
| 75 | * description receive a greybus response |
| 76 | * location operation.c:gb_connection_recv_response |
| 77 | */ |
| 78 | DEFINE_EVENT(gb_message, gb_message_recv_response, |
| 79 | |
| 80 | TP_PROTO(struct gb_message *message), |
| 81 | |
| 82 | TP_ARGS(message) |
| 83 | ); |
| 84 | |
| 85 | /* |
| 86 | * tracepoint name greybus:gb_message_cancel_outgoing |
| 87 | * description cancel outgoing greybus request |
| 88 | * location operation.c:gb_message_cancel |
| 89 | */ |
| 90 | DEFINE_EVENT(gb_message, gb_message_cancel_outgoing, |
| 91 | |
| 92 | TP_PROTO(struct gb_message *message), |
| 93 | |
| 94 | TP_ARGS(message) |
| 95 | ); |
| 96 | |
| 97 | /* |
| 98 | * tracepoint name greybus:gb_message_cancel_incoming |
| 99 | * description cancel incoming greybus request |
| 100 | * location operation.c:gb_message_cancel_incoming |
| 101 | */ |
| 102 | DEFINE_EVENT(gb_message, gb_message_cancel_incoming, |
| 103 | |
| 104 | TP_PROTO(struct gb_message *message), |
| 105 | |
| 106 | TP_ARGS(message) |
| 107 | ); |
| 108 | |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 109 | DECLARE_EVENT_CLASS(gb_host_device, |
| 110 | |
Johan Hovold | 2537636 | 2015-11-03 18:03:23 +0100 | [diff] [blame] | 111 | TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 112 | size_t payload_size), |
| 113 | |
| 114 | TP_ARGS(hd, intf_cport_id, payload_size), |
| 115 | |
| 116 | TP_STRUCT__entry( |
Johan Hovold | 2adaefb | 2015-11-25 15:59:02 +0100 | [diff] [blame] | 117 | __string(name, dev_name(&hd->dev)) |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 118 | __field(u16, intf_cport_id) |
| 119 | __field(size_t, payload_size) |
| 120 | ), |
| 121 | |
| 122 | TP_fast_assign( |
Johan Hovold | 2adaefb | 2015-11-25 15:59:02 +0100 | [diff] [blame] | 123 | __assign_str(name, dev_name(&hd->dev)) |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 124 | __entry->intf_cport_id = intf_cport_id; |
| 125 | __entry->payload_size = payload_size; |
| 126 | ), |
| 127 | |
Johan Hovold | 100e900 | 2015-12-07 15:05:38 +0100 | [diff] [blame] | 128 | TP_printk("greybus:%s if_id=%u l=%zu", __get_str(name), |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 129 | __entry->intf_cport_id, __entry->payload_size) |
| 130 | ); |
| 131 | |
| 132 | /* |
| 133 | * tracepoint name greybus:gb_host_device_send |
| 134 | * description tracepoint representing the point data are transmitted |
Viresh Kumar | e3c2593 | 2015-11-13 08:59:50 +0530 | [diff] [blame] | 135 | * location es2.c:message_send |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 136 | */ |
| 137 | DEFINE_EVENT(gb_host_device, gb_host_device_send, |
| 138 | |
Johan Hovold | 2537636 | 2015-11-03 18:03:23 +0100 | [diff] [blame] | 139 | TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 140 | size_t payload_size), |
| 141 | |
| 142 | TP_ARGS(hd, intf_cport_id, payload_size) |
| 143 | ); |
| 144 | |
| 145 | /* |
| 146 | * tracepoint name greybus:gb_host_device_recv |
| 147 | * description tracepoint representing the point data are received |
Viresh Kumar | e3c2593 | 2015-11-13 08:59:50 +0530 | [diff] [blame] | 148 | * location es2.c:cport_in_callback |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 149 | */ |
| 150 | DEFINE_EVENT(gb_host_device, gb_host_device_recv, |
| 151 | |
Johan Hovold | 2537636 | 2015-11-03 18:03:23 +0100 | [diff] [blame] | 152 | TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, |
Bryan O'Donoghue | 32b2b16 | 2015-09-22 18:06:38 -0700 | [diff] [blame] | 153 | size_t payload_size), |
| 154 | |
| 155 | TP_ARGS(hd, intf_cport_id, payload_size) |
| 156 | ); |
| 157 | |
Bryan O'Donoghue | bb03ed9 | 2015-09-18 16:38:44 +0100 | [diff] [blame] | 158 | #endif /* _TRACE_GREYBUS_H */ |
| 159 | |
| 160 | /* This part must be outside protection */ |
| 161 | #undef TRACE_INCLUDE_PATH |
| 162 | #define TRACE_INCLUDE_PATH . |
| 163 | |
| 164 | /* |
| 165 | * TRACE_INCLUDE_FILE is not needed if the filename and TRACE_SYSTEM are equal |
| 166 | */ |
| 167 | #undef TRACE_INCLUDE_FILE |
| 168 | #define TRACE_INCLUDE_FILE greybus_trace |
| 169 | #include <trace/define_trace.h> |
| 170 | |