Skip to content

Commit

Permalink
Switch saddr/daddr to u32's within tools/tcpconnlat.py (iovisor#1859)
Browse files Browse the repository at this point in the history
switch some fields from u64 to their natural size u32/u16
  • Loading branch information
kernel-z authored and yonghong-song committed Jun 27, 2018
1 parent c325d6d commit 44c28bf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tools/tcpconnlat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def positive_float(val):
struct info_t {
u64 ts;
u64 pid;
u32 pid;
char task[TASK_COMM_LEN];
};
BPF_HASH(start, struct sock *, struct info_t);
Expand All @@ -83,23 +83,23 @@ def positive_float(val):
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];
};
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];
};
Expand Down Expand Up @@ -206,23 +206,23 @@ def positive_float(val):
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)
]

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)
]
Expand Down

0 comments on commit 44c28bf

Please sign in to comment.