Switch saddr/daddr to u32's within tools/tcpconnlat.py
switch some fields from u64 to their natural size u32/u16
@@ -74,7 +74,7 @@ bpf_text = """
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 @@ BPF_HASH(start, struct sock *, struct info_t);
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 @@ BPF_PERF_OUTPUT(ipv4_events);
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 @@ TASK_COMM_LEN = 16 # linux/sched.h
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_ipv4(ct.Structure):
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)
]
