h2olog/quic: support the cc_congestion probe
@@ -105,6 +105,7 @@ struct quic_event_t {
u64 largest_acked;
u64 bytes_acked;
u64 inflight;
+ u64 max_lost_pn;
u32 cwnd;
u8 first_octet;
u32 newly_acked;
@@ -303,6 +304,26 @@ int trace_cc_ack_received(struct pt_regs *ctx) {
return 0;
}
+int trace_cc_congestion(struct pt_regs *ctx) {
+ void *pos = NULL;
+ struct quic_event_t event = {};
+ struct st_quicly_conn_t conn = {};
+ sprintf(event.type, "cc_congestion");
+
+ 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.max_lost_pn);
+ bpf_usdt_readarg(4, ctx, &event.inflight);
+ bpf_usdt_readarg(5, ctx, &event.cwnd);
+
+ if (events.perf_submit(ctx, &event, sizeof(event)) < 0)
+ bpf_trace_printk("failed to perf_submit\\n");
+
+ return 0;
+}
+
int trace_new_token_send(struct pt_regs *ctx) {
void *pos = NULL;
struct quic_event_t event = {};
@@ -408,6 +429,9 @@ def handle_quic_event(cpu, data, size):
elif line.type == "cc_ack_received":
for k in ["largest_acked", "bytes_acked", "cwnd", "inflight"]:
rv[k] = getattr(line, k)
+ elif line.type == "cc_congestion":
+ for k in ["max_lost_pn", "inflight", "cwnd"]:
+ rv[k] = getattr(line, k)
elif line.type == "new_token_send":
for k in ["token_preview", "len", "token_generation"]:
rv[k] = getattr(line, k)
@@ -478,6 +502,7 @@ if sys.argv[1] == "quic":
u.enable_probe(probe="packet_acked", fn_name="trace_packet_acked")
u.enable_probe(probe="packet_lost", fn_name="trace_packet_lost")
u.enable_probe(probe="cc_ack_received", fn_name="trace_cc_ack_received")
+ u.enable_probe(probe="cc_congestion", fn_name="trace_cc_congestion")
u.enable_probe(probe="new_token_send", fn_name="trace_new_token_send")
u.enable_probe(probe="new_token_acked", fn_name="trace_new_token_acked")
u.enable_probe(probe="new_token_receive", fn_name="trace_new_token_receive")
