quic: support the quictrace_recv_ack_delay probe
@@ -108,6 +108,7 @@ struct quic_event_t {
u32 ack_only;
u64 largest_acked;
u64 bytes_acked;
+ u64 ack_delay;
u64 inflight;
u64 max_lost_pn;
u32 cwnd;
@@ -503,6 +504,24 @@ int trace_quictrace_recv(struct pt_regs *ctx) {
return 0;
}
+int trace_quictrace_recv_ack_delay(struct pt_regs *ctx) {
+ void *pos = NULL;
+ struct quic_event_t event = {};
+ struct st_quicly_conn_t conn = {};
+ sprintf(event.type, "quictrace_recv_ack_delay");
+
+ bpf_usdt_readarg(1, ctx, &pos);
+ bpf_probe_read(&conn, sizeof(conn), pos);
+ event.master_conn_id = conn.master_id;
+ bpf_usdt_readarg(2, ctx, &event.at);
+ bpf_usdt_readarg(3, ctx, &event.ack_delay);
+
+ if (events.perf_submit(ctx, &event, sizeof(event)) < 0)
+ bpf_trace_printk("failed to perf_submit\\n");
+
+ return 0;
+}
+
int trace_quictrace_lost(struct pt_regs *ctx) {
void *pos = NULL;
struct quic_event_t event = {};
@@ -593,6 +612,9 @@ def handle_quic_event(cpu, data, size):
elif line.type == "quictrace_recv":
for k in ["packet_num"]:
rv[k] = getattr(line, k)
+ elif line.type == "quictrace_recv_ack_delay":
+ for k in ["ack_delay"]:
+ rv[k] = getattr(line, k)
elif line.type == "quictrace_lost":
for k in ["packet_num"]:
rv[k] = getattr(line, k)
@@ -670,6 +692,7 @@ if sys.argv[1] == "quic":
u.enable_probe(probe="stream_data_blocked_receive", fn_name="trace_stream_data_blocked_receive")
u.enable_probe(probe="quictrace_sent", fn_name="trace_quictrace_sent")
u.enable_probe(probe="quictrace_recv", fn_name="trace_quictrace_recv")
+ u.enable_probe(probe="quictrace_recv_ack_delay", fn_name="trace_quictrace_recv_ack_delay")
u.enable_probe(probe="quictrace_lost", fn_name="trace_quictrace_lost")
b = BPF(text=quic_bpf, usdt_contexts=[u])
else:
