Subash Abhinov Kasiviswanathan | 2139ce8a | 2016-10-14 11:01:48 -0600 | [diff] [blame^] | 1 | /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #undef TRACE_SYSTEM |
| 14 | #define TRACE_SYSTEM rmnet_data |
| 15 | #define TRACE_INCLUDE_FILE rmnet_data_trace |
| 16 | |
| 17 | #if !defined(_TRACE_MSM_LOW_POWER_H_) || defined(TRACE_HEADER_MULTI_READ) |
| 18 | #define _RMNET_DATA_TRACE_H_ |
| 19 | |
| 20 | #include <linux/netdevice.h> |
| 21 | #include <linux/skbuff.h> |
| 22 | #include <linux/tracepoint.h> |
| 23 | |
| 24 | DECLARE_EVENT_CLASS |
| 25 | (rmnet_handler_template, |
| 26 | |
| 27 | TP_PROTO(struct sk_buff *skb), |
| 28 | |
| 29 | TP_ARGS(skb), |
| 30 | |
| 31 | TP_STRUCT__entry( |
| 32 | __field(void *, skbaddr) |
| 33 | __field(unsigned int, len) |
| 34 | __string(name, skb->dev->name) |
| 35 | ), |
| 36 | |
| 37 | TP_fast_assign( |
| 38 | __entry->skbaddr = skb; |
| 39 | __entry->len = skb->len; |
| 40 | __assign_str(name, skb->dev->name); |
| 41 | ), |
| 42 | |
| 43 | TP_printk("dev=%s skbaddr=%pK len=%u", |
| 44 | __get_str(name), __entry->skbaddr, __entry->len) |
| 45 | ) |
| 46 | |
| 47 | DEFINE_EVENT |
| 48 | (rmnet_handler_template, rmnet_egress_handler, |
| 49 | |
| 50 | TP_PROTO(struct sk_buff *skb), |
| 51 | |
| 52 | TP_ARGS(skb) |
| 53 | ); |
| 54 | |
| 55 | DEFINE_EVENT |
| 56 | (rmnet_handler_template, rmnet_ingress_handler, |
| 57 | |
| 58 | TP_PROTO(struct sk_buff *skb), |
| 59 | |
| 60 | TP_ARGS(skb) |
| 61 | ); |
| 62 | |
| 63 | DEFINE_EVENT |
| 64 | (rmnet_handler_template, rmnet_vnd_start_xmit, |
| 65 | |
| 66 | TP_PROTO(struct sk_buff *skb), |
| 67 | |
| 68 | TP_ARGS(skb) |
| 69 | ); |
| 70 | |
| 71 | DEFINE_EVENT |
| 72 | (rmnet_handler_template, __rmnet_deliver_skb, |
| 73 | |
| 74 | TP_PROTO(struct sk_buff *skb), |
| 75 | |
| 76 | TP_ARGS(skb) |
| 77 | ); |
| 78 | |
| 79 | DECLARE_EVENT_CLASS |
| 80 | (rmnet_tc_fc_template, |
| 81 | |
| 82 | TP_PROTO(u32 tcm_handle, int qdisc_len, int is_enable), |
| 83 | |
| 84 | TP_ARGS(tcm_handle, qdisc_len, is_enable), |
| 85 | |
| 86 | TP_STRUCT__entry( |
| 87 | __field(u32, handle) |
| 88 | __field(int, qlen) |
| 89 | __field(int, enable) |
| 90 | ), |
| 91 | |
| 92 | TP_fast_assign( |
| 93 | __entry->handle = tcm_handle; |
| 94 | __entry->qlen = qdisc_len; |
| 95 | __entry->enable = is_enable; |
| 96 | ), |
| 97 | |
| 98 | TP_printk("tcm_handle=%d qdisc length=%d flow %s", |
| 99 | __entry->handle, __entry->qlen, |
| 100 | __entry->enable ? "enable" : "disable") |
| 101 | ) |
| 102 | |
| 103 | DEFINE_EVENT |
| 104 | (rmnet_tc_fc_template, rmnet_fc_qmi, |
| 105 | |
| 106 | TP_PROTO(u32 tcm_handle, int qdisc_len, int is_enable), |
| 107 | |
| 108 | TP_ARGS(tcm_handle, qdisc_len, is_enable) |
| 109 | ); |
| 110 | |
| 111 | DEFINE_EVENT |
| 112 | (rmnet_tc_fc_template, rmnet_fc_map, |
| 113 | |
| 114 | TP_PROTO(u32 tcm_handle, int qdisc_len, int is_enable), |
| 115 | |
| 116 | TP_ARGS(tcm_handle, qdisc_len, is_enable) |
| 117 | ); |
| 118 | |
| 119 | DECLARE_EVENT_CLASS |
| 120 | (rmnet_aggregation_template, |
| 121 | |
| 122 | TP_PROTO(struct sk_buff *skb, int num_agg_pakcets), |
| 123 | |
| 124 | TP_ARGS(skb, num_agg_pakcets), |
| 125 | |
| 126 | TP_STRUCT__entry( |
| 127 | __field(void *, skbaddr) |
| 128 | __field(unsigned int, len) |
| 129 | __string(name, skb->dev->name) |
| 130 | __field(int, num) |
| 131 | ), |
| 132 | |
| 133 | TP_fast_assign( |
| 134 | __entry->skbaddr = skb; |
| 135 | __entry->len = skb->len; |
| 136 | __assign_str(name, skb->dev->name); |
| 137 | __entry->num = num_agg_pakcets; |
| 138 | ), |
| 139 | |
| 140 | TP_printk("dev=%s skbaddr=%pK len=%u agg_count: %d", |
| 141 | __get_str(name), __entry->skbaddr, __entry->len, |
| 142 | __entry->num) |
| 143 | ) |
| 144 | |
| 145 | DEFINE_EVENT |
| 146 | (rmnet_aggregation_template, rmnet_map_aggregate, |
| 147 | |
| 148 | TP_PROTO(struct sk_buff *skb, int num_agg_pakcets), |
| 149 | |
| 150 | TP_ARGS(skb, num_agg_pakcets) |
| 151 | ); |
| 152 | |
| 153 | DEFINE_EVENT |
| 154 | (rmnet_aggregation_template, rmnet_map_flush_packet_queue, |
| 155 | |
| 156 | TP_PROTO(struct sk_buff *skb, int num_agg_pakcets), |
| 157 | |
| 158 | TP_ARGS(skb, num_agg_pakcets) |
| 159 | ); |
| 160 | |
| 161 | TRACE_EVENT |
| 162 | (rmnet_start_aggregation, |
| 163 | |
| 164 | TP_PROTO(struct sk_buff *skb), |
| 165 | |
| 166 | TP_ARGS(skb), |
| 167 | |
| 168 | TP_STRUCT__entry( |
| 169 | __string(name, skb->dev->name) |
| 170 | ), |
| 171 | |
| 172 | TP_fast_assign( |
| 173 | __assign_str(name, skb->dev->name); |
| 174 | ), |
| 175 | |
| 176 | TP_printk("dev: %s, aggregated first packet", __get_str(name)) |
| 177 | ) |
| 178 | |
| 179 | TRACE_EVENT |
| 180 | (rmnet_start_deaggregation, |
| 181 | |
| 182 | TP_PROTO(struct sk_buff *skb), |
| 183 | |
| 184 | TP_ARGS(skb), |
| 185 | |
| 186 | TP_STRUCT__entry( |
| 187 | __string(name, skb->dev->name) |
| 188 | ), |
| 189 | |
| 190 | TP_fast_assign( |
| 191 | __assign_str(name, skb->dev->name); |
| 192 | ), |
| 193 | |
| 194 | TP_printk("dev: %s, deaggregated first packet", __get_str(name)) |
| 195 | ) |
| 196 | |
| 197 | TRACE_EVENT |
| 198 | (rmnet_end_deaggregation, |
| 199 | |
| 200 | TP_PROTO(struct sk_buff *skb, int num_deagg_packets), |
| 201 | |
| 202 | TP_ARGS(skb, num_deagg_packets), |
| 203 | |
| 204 | TP_STRUCT__entry( |
| 205 | __string(name, skb->dev->name) |
| 206 | __field(int, num) |
| 207 | ), |
| 208 | |
| 209 | TP_fast_assign( |
| 210 | __assign_str(name, skb->dev->name); |
| 211 | __entry->num = num_deagg_packets; |
| 212 | ), |
| 213 | |
| 214 | TP_printk("dev: %s, deaggregate end count: %d", |
| 215 | __get_str(name), __entry->num) |
| 216 | ) |
| 217 | |
| 218 | TRACE_EVENT |
| 219 | (rmnet_map_checksum_downlink_packet, |
| 220 | |
| 221 | TP_PROTO(struct sk_buff *skb, int ckresult), |
| 222 | |
| 223 | TP_ARGS(skb, ckresult), |
| 224 | |
| 225 | TP_STRUCT__entry( |
| 226 | __string(name, skb->dev->name) |
| 227 | __field(int, res) |
| 228 | ), |
| 229 | |
| 230 | TP_fast_assign( |
| 231 | __assign_str(name, skb->dev->name); |
| 232 | __entry->res = ckresult; |
| 233 | ), |
| 234 | |
| 235 | TP_printk("DL checksum on dev=%s, res: %d", |
| 236 | __get_str(name), __entry->res) |
| 237 | ) |
| 238 | |
| 239 | TRACE_EVENT |
| 240 | (rmnet_map_checksum_uplink_packet, |
| 241 | |
| 242 | TP_PROTO(struct net_device *dev, int ckresult), |
| 243 | |
| 244 | TP_ARGS(dev, ckresult), |
| 245 | |
| 246 | TP_STRUCT__entry( |
| 247 | __string(name, dev->name) |
| 248 | __field(int, res) |
| 249 | ), |
| 250 | |
| 251 | TP_fast_assign( |
| 252 | __assign_str(name, dev->name); |
| 253 | __entry->res = ckresult; |
| 254 | ), |
| 255 | |
| 256 | TP_printk("UL checksum on dev=%s, res: %d", |
| 257 | __get_str(name), __entry->res) |
| 258 | ) |
| 259 | |
| 260 | DECLARE_EVENT_CLASS |
| 261 | (rmnet_physdev_action_template, |
| 262 | |
| 263 | TP_PROTO(struct net_device *dev), |
| 264 | |
| 265 | TP_ARGS(dev), |
| 266 | |
| 267 | TP_STRUCT__entry( |
| 268 | __string(name, dev->name) |
| 269 | ), |
| 270 | |
| 271 | TP_fast_assign( |
| 272 | __assign_str(name, dev->name); |
| 273 | ), |
| 274 | |
| 275 | TP_printk("Physical dev=%s", __get_str(name)) |
| 276 | ) |
| 277 | |
| 278 | DEFINE_EVENT |
| 279 | (rmnet_physdev_action_template, rmnet_unregister_cb_unhandled, |
| 280 | |
| 281 | TP_PROTO(struct net_device *dev), |
| 282 | |
| 283 | TP_ARGS(dev) |
| 284 | ); |
| 285 | |
| 286 | DEFINE_EVENT |
| 287 | (rmnet_physdev_action_template, rmnet_unregister_cb_entry, |
| 288 | |
| 289 | TP_PROTO(struct net_device *dev), |
| 290 | |
| 291 | TP_ARGS(dev) |
| 292 | ); |
| 293 | |
| 294 | DEFINE_EVENT |
| 295 | (rmnet_physdev_action_template, rmnet_unregister_cb_exit, |
| 296 | |
| 297 | TP_PROTO(struct net_device *dev), |
| 298 | |
| 299 | TP_ARGS(dev) |
| 300 | ); |
| 301 | |
| 302 | DEFINE_EVENT |
| 303 | (rmnet_physdev_action_template, rmnet_unregister_cb_clear_vnds, |
| 304 | |
| 305 | TP_PROTO(struct net_device *dev), |
| 306 | |
| 307 | TP_ARGS(dev) |
| 308 | ); |
| 309 | |
| 310 | DEFINE_EVENT |
| 311 | (rmnet_physdev_action_template, rmnet_unregister_cb_clear_lepcs, |
| 312 | |
| 313 | TP_PROTO(struct net_device *dev), |
| 314 | |
| 315 | TP_ARGS(dev) |
| 316 | ); |
| 317 | |
| 318 | DEFINE_EVENT |
| 319 | (rmnet_physdev_action_template, rmnet_associate, |
| 320 | |
| 321 | TP_PROTO(struct net_device *dev), |
| 322 | |
| 323 | TP_ARGS(dev) |
| 324 | ); |
| 325 | |
| 326 | DEFINE_EVENT |
| 327 | (rmnet_physdev_action_template, rmnet_unassociate, |
| 328 | |
| 329 | TP_PROTO(struct net_device *dev), |
| 330 | |
| 331 | TP_ARGS(dev) |
| 332 | ); |
| 333 | |
| 334 | TRACE_EVENT |
| 335 | (rmnet_gro_downlink, |
| 336 | |
| 337 | TP_PROTO(gro_result_t gro_res), |
| 338 | |
| 339 | TP_ARGS(gro_res), |
| 340 | |
| 341 | TP_STRUCT__entry( |
| 342 | __field(gro_result_t, res) |
| 343 | ), |
| 344 | |
| 345 | TP_fast_assign( |
| 346 | __entry->res = gro_res; |
| 347 | ), |
| 348 | |
| 349 | TP_printk("GRO res: %d", __entry->res) |
| 350 | ) |
| 351 | |
| 352 | #endif /* _RMNET_DATA_TRACE_H_ */ |
| 353 | |
| 354 | /* This part must be outside protection */ |
| 355 | #undef TRACE_INCLUDE_PATH |
| 356 | #define TRACE_INCLUDE_PATH . |
| 357 | #include <trace/define_trace.h> |
| 358 | |