net: Add TCP header data to net_* tracepoints
This patch adds the transport header variant field in the network types IPv4
and IPv6 using the corresponding next protocol field in both types. It adds
the detailed fields of the TCP header. Other transport headers are empty.
Example output from babeltrace:
[13:21:04.
392017771] (+0.
000588730) qemulttng0 net_dev_queue: { cpu_id = 1 },
{ skbaddr = 0xFFFF88003C8390E8, len = 370, name = "ens3",
network_header_type = ( "_ipv4" : container = 1 ),
network_header = { ipv4 = { version = 4, ihl = 5, tos = 16, tot_len = 356,
id = 0xFA2F, frag_off = 16384, ttl = 64,
protocol = ( "_tcp" : container = 6 ), checksum = 0x173C,
saddr_padding = { }, saddr = [ [0] = 10, [1] = 0, [2] = 10, [3] = 24 ],
daddr_padding = { }, daddr = [ [0] = 10, [1] = 0, [2] = 10, [3] = 1 ],
transport_header = { tcp = { source_port = 22, dest_port = 47500,
seq =
2784866942, ack_seq =
3750103494, data_offset = 8, reserved = 0,
flags = 0x11, window_size = 305, checksum = 0x296F, urg_ptr = 0 }
} } } }
[13:21:04.
429861105] (+0.
037671848) qemulttng0 net_dev_queue: { cpu_id = 1 },
{ skbaddr = 0xFFFF88003DBFC800, len = 86, name = "ens3",
network_header_type = ( "_ipv6" : container = 2 ),
network_header = { ipv6 = { version = 6, prio = 0, flow_lbl_padding = { },
flow_lbl = [ [0] = 0x84, [1] = 0x41, [2] = 0x6F ], payload_len = 32,
nexthdr = ( "_tcp" : container = 6 ), hop_limit = 64,
saddr_padding = { }, saddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
[4] = 0x5054, [5] = 0xFF, [6] = 0xFE12, [7] = 0x3456 ],
daddr_padding = { }, daddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
[4] = 0x5054, [5] = 0xFF, [6] = 0xFE22, [7] = 0x3344 ],
transport_header = { tcp = { source_port = 36972, dest_port = 22,
seq =
3750103494, ack_seq =
2784866942, data_offset = 0, reserved = 0,
flags = 0x11, window_size = 256, checksum = 0x39F, urg_ptr = 0 }
} } } }
[13:21:08.
195490138] (+3.
765629033) qemulttng0 net_if_receive_skb: { cpu_id = 0 },
{ skbaddr = 0xFFFF88003C0B8C00, len = 72, name = "ens3",
network_header_type = ( "_ipv6" : container = 2 ),
network_header = { ipv6 = { version = 6, prio = 0, flow_lbl_padding = { },
flow_lbl = [ [0] = 0x84, [1] = 0xCB, [2] = 0x7F ], payload_len = 32,
nexthdr = ( "_unknown" : container = 58 ), hop_limit = 255,
saddr_padding = { }, saddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
[4] = 0x40C, [5] = 0xA9FF, [6] = 0xFEB5, [7] = 0xA75B ],
daddr_padding = { }, daddr = [ [0] = 0xFE80, [1] = 0x0, [2] = 0x0, [3] = 0x0,
[4] = 0x5054, [5] = 0xFF, [6] = 0xFE12, [7] = 0x3456 ],
transport_header = { unknown = { }
} } } }
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>