Switch saddr/daddr to u32's within tools/tcpconnlat.py (#1859)
switch some fields from u64 to their natural size u32/u16
diff --git a/tools/tcpconnlat.py b/tools/tcpconnlat.py
index 8bfeb1e..c674596 100755
--- a/tools/tcpconnlat.py
+++ b/tools/tcpconnlat.py
@@ -74,7 +74,7 @@
struct info_t {
u64 ts;
- u64 pid;
+ u32 pid;
char task[TASK_COMM_LEN];
};
BPF_HASH(start, struct sock *, struct info_t);
@@ -83,11 +83,11 @@
struct ipv4_data_t {
// XXX: switch some to u32's when supported
u64 ts_us;
- u64 pid;
- u64 saddr;
- u64 daddr;
+ u32 pid;
+ u32 saddr;
+ u32 daddr;
u64 ip;
- u64 dport;
+ u16 dport;
u64 delta_us;
char task[TASK_COMM_LEN];
};
@@ -95,11 +95,11 @@
struct ipv6_data_t {
u64 ts_us;
- u64 pid;
+ u32 pid;
unsigned __int128 saddr;
unsigned __int128 daddr;
u64 ip;
- u64 dport;
+ u16 dport;
u64 delta_us;
char task[TASK_COMM_LEN];
};
@@ -206,11 +206,11 @@
class Data_ipv4(ct.Structure):
_fields_ = [
("ts_us", ct.c_ulonglong),
- ("pid", ct.c_ulonglong),
- ("saddr", ct.c_ulonglong),
- ("daddr", ct.c_ulonglong),
+ ("pid", ct.c_uint),
+ ("saddr", ct.c_uint),
+ ("daddr", ct.c_uint),
("ip", ct.c_ulonglong),
- ("dport", ct.c_ulonglong),
+ ("dport", ct.c_ushort),
("delta_us", ct.c_ulonglong),
("task", ct.c_char * TASK_COMM_LEN)
]
@@ -218,11 +218,11 @@
class Data_ipv6(ct.Structure):
_fields_ = [
("ts_us", ct.c_ulonglong),
- ("pid", ct.c_ulonglong),
+ ("pid", ct.c_uint),
("saddr", (ct.c_ulonglong * 2)),
("daddr", (ct.c_ulonglong * 2)),
("ip", ct.c_ulonglong),
- ("dport", ct.c_ulonglong),
+ ("dport", ct.c_ushort),
("delta_us", ct.c_ulonglong),
("task", ct.c_char * TASK_COMM_LEN)
]