Move headers under include/
[lttng-modules.git] / include / instrumentation / events / lttng-module / net.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM net
4
5 #if !defined(LTTNG_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_NET_H
7
8 #include <lttng/lttng-tracepoint-event.h>
9 #include <linux/skbuff.h>
10 #include <linux/netdevice.h>
11 #include <linux/ip.h>
12 #include <linux/ipv6.h>
13 #include <linux/tcp.h>
14 #include <linux/udp.h>
15 #include <linux/icmp.h>
16 #include <lttng/lttng-endian.h>
17 #include <net/sock.h>
18
19 #ifndef ONCE_LTTNG_NET_H
20 #define ONCE_LTTNG_NET_H
21
22 static inline unsigned char __has_network_hdr(struct sk_buff *skb)
23 {
24 /*
25 * If the header is not set yet, the network header will point
26 * to the head.
27 */
28 return skb_network_header(skb) != skb->head;
29 }
30
31 static struct lttng_event_field emptyfields[] = {
32 };
33
34 /* Structures for transport headers. */
35
36 static struct lttng_event_field tcpfields[] = {
37 [0] = {
38 .name = "source_port",
39 .type = __type_integer(uint16_t, 0, 0, 0,
40 __BIG_ENDIAN, 10, none),
41 },
42 [1] = {
43 .name = "dest_port",
44 .type = __type_integer(uint16_t, 0, 0, 0,
45 __BIG_ENDIAN, 10, none),
46 },
47 [2] = {
48 .name = "seq",
49 .type = __type_integer(uint32_t, 0, 0, 0,
50 __BIG_ENDIAN, 10, none),
51 },
52 [3] = {
53 .name = "ack_seq",
54 .type = __type_integer(uint32_t, 0, 0, 0,
55 __BIG_ENDIAN, 10, none),
56 },
57 [4] = {
58 .name = "data_offset",
59 .type = __type_integer(uint8_t, 4, 4, 0,
60 __BIG_ENDIAN, 10, none),
61 },
62 [5] = {
63 .name = "reserved",
64 .type = __type_integer(uint8_t, 3, 1, 0,
65 __BIG_ENDIAN, 10, none),
66 },
67 [6] = {
68 .name = "flags",
69 .type = __type_integer(uint8_t, 9, 1, 0,
70 __BIG_ENDIAN, 16, none),
71 },
72 [7] = {
73 .name = "window_size",
74 .type = __type_integer(uint16_t, 0, 0, 0,
75 __BIG_ENDIAN, 10, none),
76 },
77 [8] = {
78 .name = "checksum",
79 .type = __type_integer(uint16_t, 0, 0, 0,
80 __BIG_ENDIAN, 16, none),
81 },
82 [9] = {
83 .name = "urg_ptr",
84 .type = __type_integer(uint16_t, 0, 0, 0,
85 __BIG_ENDIAN, 10, none),
86 },
87 };
88
89 static struct lttng_event_field udpfields[] = {
90 [0] = {
91 .name = "source_port",
92 .type = __type_integer(uint16_t, 0, 0, 0,
93 __BIG_ENDIAN, 10, none),
94 },
95 [1] = {
96 .name = "dest_port",
97 .type = __type_integer(uint16_t, 0, 0, 0,
98 __BIG_ENDIAN, 10, none),
99 },
100 [2] = {
101 .name = "len",
102 .type = __type_integer(uint16_t, 0, 0, 0,
103 __BIG_ENDIAN, 10, none),
104 },
105 [3] = {
106 .name = "check",
107 .type = __type_integer(uint16_t, 0, 0, 0,
108 __BIG_ENDIAN, 10, none),
109 },
110 };
111
112 static struct lttng_event_field icmpfields[] = {
113 [0] = {
114 .name = "type",
115 .type = __type_integer(uint8_t, 0, 0, 0,
116 __BIG_ENDIAN, 10, none),
117 },
118 [1] = {
119 .name = "code",
120 .type = __type_integer(uint8_t, 0, 0, 0,
121 __BIG_ENDIAN, 10, none),
122 },
123 [2] = {
124 .name = "checksum",
125 .type = __type_integer(uint16_t, 0, 0, 0,
126 __BIG_ENDIAN, 10, none),
127 },
128 [3] = {
129 .name = "gateway",
130 .type = __type_integer(uint32_t, 0, 0, 0,
131 __BIG_ENDIAN, 10, none),
132 },
133 };
134
135
136 static struct lttng_event_field transport_fields[] = {
137 [0] = {
138 .name = "unknown",
139 .type = {
140 .atype = atype_struct_nestable,
141 .u.struct_nestable.nr_fields = ARRAY_SIZE(emptyfields),
142 .u.struct_nestable.fields = emptyfields,
143 .u.struct_nestable.alignment = 0,
144 },
145 .nofilter = 1,
146 },
147 [1] = {
148 .name = "tcp",
149 .type = {
150 .atype = atype_struct_nestable,
151 .u.struct_nestable.nr_fields = ARRAY_SIZE(tcpfields),
152 .u.struct_nestable.fields = tcpfields,
153 .u.struct_nestable.alignment = 0,
154 },
155 .nofilter = 1,
156 },
157 [2] = {
158 .name = "udp",
159 .type = {
160 .atype = atype_struct_nestable,
161 .u.struct_nestable.nr_fields = ARRAY_SIZE(udpfields),
162 .u.struct_nestable.fields = udpfields,
163 .u.struct_nestable.alignment = 0,
164 },
165 .nofilter = 1,
166 },
167 [3] = {
168 .name = "icmp",
169 .type = {
170 .atype = atype_struct_nestable,
171 .u.struct_nestable.nr_fields = ARRAY_SIZE(icmpfields),
172 .u.struct_nestable.fields = icmpfields,
173 .u.struct_nestable.alignment = 0,
174 },
175 .nofilter = 1,
176 },
177 };
178
179 enum transport_header_types {
180 TH_NONE = 0,
181 TH_TCP = 1,
182 TH_UDP = 2,
183 TH_ICMP = 3,
184 };
185
186 static inline enum transport_header_types __get_transport_header_type_ip(struct sk_buff *skb)
187 {
188 switch (ip_hdr(skb)->protocol) {
189 case IPPROTO_TCP:
190 return TH_TCP;
191 case IPPROTO_UDP:
192 return TH_UDP;
193 case IPPROTO_ICMP:
194 return TH_ICMP;
195 }
196 return TH_NONE;
197 }
198
199 static inline enum transport_header_types __get_transport_header_type_ipv6(struct sk_buff *skb)
200 {
201 switch (ipv6_hdr(skb)->nexthdr) {
202 case IPPROTO_TCP:
203 return TH_TCP;
204 case IPPROTO_UDP:
205 return TH_UDP;
206 case IPPROTO_ICMP:
207 return TH_ICMP;
208 }
209 return TH_NONE;
210 }
211
212 static inline enum transport_header_types __get_transport_header_type(struct sk_buff *skb)
213 {
214 if (__has_network_hdr(skb)) {
215 /*
216 * When both transport and network headers are set,
217 * transport header is greater than network header,
218 * otherwise it points to head.
219 */
220 if (skb->transport_header > skb->network_header) {
221 /*
222 * Get the transport protocol from the network
223 * header's data. This method works both for
224 * sent and received packets.
225 */
226 if (skb->protocol == htons(ETH_P_IP)) {
227 return __get_transport_header_type_ip(skb);
228 } else if(skb->protocol == htons(ETH_P_IPV6)) {
229 return __get_transport_header_type_ipv6(skb);
230 }
231 }
232 /* Fallthrough for other cases where header is not recognized. */
233 }
234 return TH_NONE;
235 }
236
237 static struct lttng_enum_entry proto_transport_enum_entries[] = {
238 [0] = {
239 .start = { .value = 0, .signedness = 0, },
240 .end = { .value = IPPROTO_ICMP - 1, .signedness = 0, },
241 .string = "_unknown",
242 },
243 [1] = {
244 .start = { .value = IPPROTO_ICMP, .signedness = 0, },
245 .end = { .value = IPPROTO_ICMP, .signedness = 0, },
246 .string = "_icmp",
247 },
248 [2] = {
249 .start = { .value = IPPROTO_ICMP + 1, .signedness = 0, },
250 .end = { .value = IPPROTO_TCP - 1, .signedness = 0, },
251 .string = "_unknown",
252 },
253 [3] = {
254 .start = { .value = IPPROTO_TCP, .signedness = 0, },
255 .end = { .value = IPPROTO_TCP, .signedness = 0, },
256 .string = "_tcp",
257 },
258 [4] = {
259 .start = { .value = IPPROTO_TCP + 1, .signedness = 0, },
260 .end = { .value = IPPROTO_UDP - 1, .signedness = 0, },
261 .string = "_unknown",
262 },
263 [5] = {
264 .start = { .value = IPPROTO_UDP, .signedness = 0, },
265 .end = { .value = IPPROTO_UDP, .signedness = 0, },
266 .string = "_udp",
267 },
268 [6] = {
269 .start = { .value = IPPROTO_UDP + 1, .signedness = 0, },
270 .end = { .value = 255, .signedness = 0, },
271 .string = "_unknown",
272 },
273 };
274
275 static const struct lttng_enum_desc proto_transport_header_type = {
276 .name = "proto_transport_header_type",
277 .entries = proto_transport_enum_entries,
278 .nr_entries = ARRAY_SIZE(proto_transport_enum_entries),
279 };
280
281 static struct lttng_enum_entry transport_enum_entries[] = {
282 [0] = {
283 .start = { .value = TH_NONE, .signedness = 0, },
284 .end = { .value = TH_NONE, .signedness = 0, },
285 .string = "_unknown",
286 },
287 [1] = {
288 .start = { .value = TH_TCP, .signedness = 0, },
289 .end = { .value = TH_TCP, .signedness = 0, },
290 .string = "_tcp",
291 },
292 [2] = {
293 .start = { .value = TH_UDP, .signedness = 0, },
294 .end = { .value = TH_UDP, .signedness = 0, },
295 .string = "_udp",
296 },
297 [3] = {
298 .start = { .value = TH_ICMP, .signedness = 0, },
299 .end = { .value = TH_ICMP, .signedness = 0, },
300 .string = "_icmp",
301 },
302 };
303
304 static const struct lttng_enum_desc transport_header_type = {
305 .name = "transport_header_type",
306 .entries = transport_enum_entries,
307 .nr_entries = ARRAY_SIZE(transport_enum_entries),
308 };
309
310 /* Structures for network headers. */
311
312 static struct lttng_event_field ipv4fields[] = {
313 [0] = {
314 .name = "version",
315 .type = __type_integer(uint8_t, 4, 4, 0,
316 __BIG_ENDIAN, 10, none),
317 },
318 [1] = {
319 .name = "ihl",
320 .type = __type_integer(uint8_t, 4, 4, 0,
321 __BIG_ENDIAN, 10, none),
322 },
323 [2] = {
324 .name = "tos",
325 .type = __type_integer(uint8_t, 0, 0, 0,
326 __BIG_ENDIAN, 10, none),
327 },
328 [3] = {
329 .name = "tot_len",
330 .type = __type_integer(uint16_t, 0, 0, 0,
331 __BIG_ENDIAN, 10, none),
332 },
333 [4] = {
334 .name = "id",
335 .type = __type_integer(uint16_t, 0, 0, 0,
336 __BIG_ENDIAN, 16, none),
337 },
338 [5] = {
339 .name = "frag_off",
340 .type = __type_integer(uint16_t, 0, 0, 0,
341 __BIG_ENDIAN, 10, none),
342 },
343 [6] = {
344 .name = "ttl",
345 .type = __type_integer(uint8_t, 0, 0, 0,
346 __BIG_ENDIAN, 10, none),
347 },
348 [7] = {
349 .name = "protocol",
350 .type = {
351 .atype = atype_enum_nestable,
352 .u.enum_nestable.desc =
353 &proto_transport_header_type,
354 .u.enum_nestable.container_type =
355 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
356 __type_integer(uint8_t, 0, 0, -1,
357 __BIG_ENDIAN, 10, none)),
358 },
359 },
360 [8] = {
361 .name = "checksum",
362 .type = __type_integer(uint16_t, 0, 0, 0,
363 __BIG_ENDIAN, 16, none),
364 },
365 [9] = {
366 .name = "saddr",
367 .type = {
368 .atype = atype_array_nestable,
369 .u.array_nestable.elem_type =
370 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
371 __type_integer(uint8_t, 0, 0, 0,
372 __BIG_ENDIAN, 10, none)),
373 .u.array_nestable.length = 4,
374 .u.array_nestable.alignment = lttng_alignof(uint8_t),
375 },
376 },
377 [10] = {
378 .name = "daddr",
379 .type = {
380 .atype = atype_array_nestable,
381 .u.array_nestable.elem_type =
382 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
383 __type_integer(uint8_t, 0, 0, 0,
384 __BIG_ENDIAN, 10, none)),
385 .u.array_nestable.length = 4,
386 .u.array_nestable.alignment = lttng_alignof(uint8_t),
387 },
388 },
389 [11] = {
390 .name = "transport_header_type",
391 .type = {
392 .atype = atype_enum_nestable,
393 .u.enum_nestable.desc = &transport_header_type,
394 .u.enum_nestable.container_type =
395 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
396 __type_integer(uint8_t, 0, 0, -1,
397 __BYTE_ORDER, 10, none)),
398 },
399 },
400 [12] = {
401 .name = "transport_header",
402 .type = {
403 .atype = atype_variant_nestable,
404 .u.variant_nestable.tag_name = "transport_header_type",
405 .u.variant_nestable.choices = transport_fields,
406 .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields),
407 .u.variant_nestable.alignment = 0,
408 },
409 },
410 };
411
412 static struct lttng_event_field ipv6fields[] = {
413 [0] = {
414 .name = "version",
415 .type = __type_integer(uint8_t, 4, 4, 0,
416 __BIG_ENDIAN, 10, none),
417 },
418 [1] = {
419 .name = "prio",
420 .type = __type_integer(uint8_t, 4, 4, 0,
421 __BIG_ENDIAN, 10, none),
422 },
423 [2] = {
424 .name = "flow_lbl",
425 .type = {
426 .atype = atype_array_nestable,
427 .u.array_nestable.elem_type =
428 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
429 __type_integer(uint8_t, 0, 0, 0,
430 __BIG_ENDIAN, 16, none)),
431 .u.array_nestable.length = 3,
432 .u.array_nestable.alignment = lttng_alignof(uint8_t),
433 },
434 },
435 [3] = {
436 .name = "payload_len",
437 .type = __type_integer(uint16_t, 0, 0, 0,
438 __BIG_ENDIAN, 10, none),
439 },
440 [4] = {
441 .name = "nexthdr",
442 .type = {
443 .atype = atype_enum_nestable,
444 .u.enum_nestable.desc =
445 &proto_transport_header_type,
446 .u.enum_nestable.container_type =
447 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
448 __type_integer(uint8_t, 0, 0, -1,
449 __BIG_ENDIAN, 10, none)),
450 },
451 },
452 [5] = {
453 .name = "hop_limit",
454 .type = __type_integer(uint8_t, 0, 0, 0,
455 __BIG_ENDIAN, 10, none),
456 },
457 [6] = {
458 .name = "saddr",
459 .type = {
460 .atype = atype_array_nestable,
461 .u.array_nestable.elem_type =
462 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
463 __type_integer(uint16_t, 0, 0, 0,
464 __BIG_ENDIAN, 16, none)),
465 .u.array_nestable.length = 8,
466 .u.array_nestable.alignment = lttng_alignof(uint16_t),
467 },
468 },
469 [7] = {
470 .name = "daddr",
471 .type = {
472 .atype = atype_array_nestable,
473 .u.array_nestable.elem_type =
474 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
475 __type_integer(uint16_t, 0, 0, 0,
476 __BIG_ENDIAN, 16, none)),
477 .u.array_nestable.length = 8,
478 .u.array_nestable.alignment = lttng_alignof(uint16_t),
479 },
480 },
481 [8] = {
482 .name = "transport_header_type",
483 .type = {
484 .atype = atype_enum_nestable,
485 .u.enum_nestable.desc = &transport_header_type,
486 .u.enum_nestable.container_type =
487 __LTTNG_COMPOUND_LITERAL(struct lttng_type,
488 __type_integer(uint8_t, 0, 0, -1,
489 __BYTE_ORDER, 10, none)),
490 },
491 },
492 [9] = {
493 .name = "transport_header",
494 .type = {
495 .atype = atype_variant_nestable,
496 .u.variant_nestable.tag_name = "transport_header_type",
497 .u.variant_nestable.choices = transport_fields,
498 .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields),
499 .u.variant_nestable.alignment = 0,
500 },
501 },
502 };
503
504 static struct lttng_event_field network_fields[] = {
505 [0] = {
506 .name = "unknown",
507 .type = {
508 .atype = atype_struct_nestable,
509 .u.struct_nestable.nr_fields = 0,
510 .u.struct_nestable.fields = emptyfields,
511 .u.struct_nestable.alignment = 0,
512 },
513 },
514 [1] = {
515 .name = "ipv4",
516 .type = {
517 .atype = atype_struct_nestable,
518 .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv4fields),
519 .u.struct_nestable.fields = ipv4fields,
520 .u.struct_nestable.alignment = 0,
521 },
522 },
523 [2] = {
524 .name = "ipv6",
525 .type = {
526 .atype = atype_struct_nestable,
527 .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv6fields),
528 .u.struct_nestable.fields = ipv6fields,
529 .u.struct_nestable.alignment = 0,
530 },
531 },
532 };
533
534 enum network_header_types {
535 NH_NONE,
536 NH_IPV4,
537 NH_IPV6,
538 };
539
540 static inline unsigned char __get_network_header_type(struct sk_buff *skb)
541 {
542 if (__has_network_hdr(skb)) {
543 if (skb->protocol == htons(ETH_P_IPV6))
544 return NH_IPV6;
545 else if (skb->protocol == htons(ETH_P_IP))
546 return NH_IPV4;
547 /* Fallthrough for other header types. */
548 }
549 return NH_NONE;
550 }
551
552 #endif
553
554 LTTNG_TRACEPOINT_ENUM(net_network_header,
555 TP_ENUM_VALUES(
556 ctf_enum_value("_unknown", NH_NONE)
557 ctf_enum_value("_ipv4", NH_IPV4)
558 ctf_enum_value("_ipv6", NH_IPV6)
559 )
560 )
561
562 LTTNG_TRACEPOINT_EVENT(net_dev_xmit,
563
564 TP_PROTO(struct sk_buff *skb,
565 int rc,
566 struct net_device *dev,
567 unsigned int skb_len),
568
569 TP_ARGS(skb, rc, dev, skb_len),
570
571 TP_FIELDS(
572 ctf_integer_hex(void *, skbaddr, skb)
573 ctf_integer(int, rc, rc)
574 ctf_integer(unsigned int, len, skb_len)
575 ctf_string(name, dev->name)
576 )
577 )
578
579 LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_template,
580
581 TP_PROTO(struct sk_buff *skb),
582
583 TP_ARGS(skb),
584
585 TP_FIELDS(
586 ctf_integer_hex(void *, skbaddr, skb)
587 ctf_integer(unsigned int, len, skb->len)
588 ctf_string(name, skb->dev->name)
589 ctf_enum(net_network_header, unsigned char,
590 network_header_type, __get_network_header_type(skb))
591 ctf_custom_field(
592 ctf_custom_type(
593 {
594 .atype = atype_variant_nestable,
595 .u.variant_nestable.tag_name = "network_header_type",
596 .u.variant_nestable.choices = network_fields,
597 .u.variant_nestable.nr_choices =
598 ARRAY_SIZE(network_fields),
599 .u.variant_nestable.alignment = 0,
600 }
601 ),
602 network_header,
603 ctf_custom_code(
604 bool has_network_header = false;
605
606 /* Copy the network header. */
607 switch (__get_network_header_type(skb)) {
608 case NH_IPV4: {
609 ctf_align(uint16_t)
610 ctf_array_type(uint8_t, ip_hdr(skb),
611 sizeof(struct iphdr))
612 has_network_header = true;
613 break;
614 }
615 case NH_IPV6: {
616 ctf_align(uint16_t)
617 ctf_array_type(uint8_t, ipv6_hdr(skb),
618 sizeof(struct ipv6hdr))
619 has_network_header = true;
620 break;
621 }
622 default:
623 /*
624 * For any other network header
625 * type, there is nothing to do.
626 */
627 break;
628 }
629
630 if (has_network_header) {
631 enum transport_header_types th_type =
632 __get_transport_header_type(skb);
633
634 /* Transport header type field. */
635 ctf_integer_type(unsigned char, th_type)
636
637 /* Copy the transport header. */
638 switch (th_type) {
639 case TH_TCP: {
640 ctf_align(uint32_t)
641 ctf_array_type(uint8_t, tcp_hdr(skb),
642 sizeof(struct tcphdr))
643 break;
644 }
645 case TH_UDP: {
646 ctf_align(uint32_t)
647 ctf_array_type(uint8_t, udp_hdr(skb),
648 sizeof(struct udphdr))
649 break;
650 }
651 case TH_ICMP: {
652 ctf_align(uint32_t)
653 ctf_array_type(uint8_t, icmp_hdr(skb),
654 sizeof(struct icmphdr))
655 break;
656 }
657 default:
658 /*
659 * For any other transport header type,
660 * there is nothing to do.
661 */
662 break;
663 }
664 }
665 )
666 )
667 )
668 )
669
670 LTTNG_TRACEPOINT_EVENT_INSTANCE(net_dev_template, net_dev_queue,
671
672 TP_PROTO(struct sk_buff *skb),
673
674 TP_ARGS(skb)
675 )
676
677 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template,
678
679 netif_receive_skb,
680
681 net_if_receive_skb,
682
683 TP_PROTO(struct sk_buff *skb),
684
685 TP_ARGS(skb)
686 )
687
688 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template,
689
690 netif_rx,
691
692 net_if_rx,
693
694 TP_PROTO(struct sk_buff *skb),
695
696 TP_ARGS(skb)
697 )
698
699 /* Trace events for the receive entry points */
700 LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_entry_template,
701
702 TP_PROTO(const struct sk_buff *skb),
703
704 TP_ARGS(skb),
705
706 TP_FIELDS(
707 ctf_integer_hex(const void *, skbaddr, skb)
708 )
709 )
710
711 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
712
713 napi_gro_frags_entry,
714
715 net_napi_gro_frags_entry,
716
717 TP_PROTO(const struct sk_buff *skb),
718
719 TP_ARGS(skb)
720 )
721
722 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
723
724 napi_gro_receive_entry,
725
726 net_napi_gro_receive_entry,
727
728 TP_PROTO(const struct sk_buff *skb),
729
730 TP_ARGS(skb)
731 )
732
733 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
734
735 netif_receive_skb_entry,
736
737 net_if_receive_skb_entry,
738
739 TP_PROTO(const struct sk_buff *skb),
740
741 TP_ARGS(skb)
742 )
743
744 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
745
746 netif_rx_entry,
747
748 net_if_rx_entry,
749
750 TP_PROTO(const struct sk_buff *skb),
751
752 TP_ARGS(skb)
753 )
754
755 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
756
757 netif_rx_ni_entry,
758
759 net_if_rx_ni_entry,
760
761 TP_PROTO(const struct sk_buff *skb),
762
763 TP_ARGS(skb)
764 )
765
766 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template,
767
768 netif_receive_skb_list_entry,
769
770 net_if_receive_skb_list_entry,
771
772 TP_PROTO(const struct sk_buff *skb),
773
774 TP_ARGS(skb)
775 )
776
777 /* Trace events for the receive exit points */
778 LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_exit_template,
779
780 TP_PROTO(int ret),
781
782 TP_ARGS(ret),
783
784 TP_FIELDS(
785 ctf_integer(int, ret, ret)
786 )
787 )
788
789 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
790
791 napi_gro_frags_exit,
792
793 net_napi_gro_frags_exit,
794
795 TP_PROTO(int ret),
796
797 TP_ARGS(ret)
798 )
799
800 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
801
802 napi_gro_receive_exit,
803
804 net_napi_gro_receive_exit,
805
806 TP_PROTO(int ret),
807
808 TP_ARGS(ret)
809 )
810
811 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
812
813 netif_receive_skb_exit,
814
815 net_if_receive_skb_exit,
816
817 TP_PROTO(int ret),
818
819 TP_ARGS(ret)
820 )
821
822 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
823
824 netif_rx_exit,
825
826 net_if_rx_exit,
827
828 TP_PROTO(int ret),
829
830 TP_ARGS(ret)
831 )
832
833 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
834
835 netif_rx_ni_exit,
836
837 net_if_rx_ni_exit,
838
839 TP_PROTO(int ret),
840
841 TP_ARGS(ret)
842 )
843
844 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template,
845
846 netif_receive_skb_list_exit,
847
848 net_if_receive_skb_list_exit,
849
850 TP_PROTO(int ret),
851
852 TP_ARGS(ret)
853 )
854
855 #endif /* LTTNG_TRACE_NET_H */
856
857 /* This part must be outside protection */
858 #include <lttng/define_trace.h>
This page took 0.047219 seconds and 4 git commands to generate.