quic: support the stream_data_blocked_receive probe
@@ -101,6 +101,7 @@ struct quic_event_t {
char token_preview[TOKEN_PREVIEW_LEN];
u64 at;
u32 master_conn_id;
+ u64 stream_id;
u64 packet_num;
u64 packet_len;
u32 ack_only;
@@ -443,6 +444,25 @@ int trace_data_blocked_receive(struct pt_regs *ctx) {
return 0;
}
+
+int trace_stream_data_blocked_receive(struct pt_regs *ctx) {
+ void *pos = NULL;
+ struct quic_event_t event = {};
+ struct st_quicly_conn_t conn = {};
+ sprintf(event.type, "stream_data_blocked_receive");
+
+ 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.stream_id);
+ bpf_usdt_readarg(4, ctx, &event.limit);
+
+ if (events.perf_submit(ctx, &event, sizeof(event)) < 0)
+ bpf_trace_printk("failed to perf_submit\\n");
+
+ return 0;
+}
"""
def handle_req_line(cpu, data, size):
@@ -499,6 +519,9 @@ def handle_quic_event(cpu, data, size):
rv["token_preview"] = binascii.hexlify(rv["token_preview"])
elif line.type == "new_token_acked":
rv["token_generation"] = getattr(line, "token_generation")
+ elif line.type == "stream_data_blocked_receive":
+ for k in ["stream_id", "limit"]:
+ rv[k] = getattr(line, k)
print(json.dumps(rv))
@@ -570,6 +593,7 @@ if sys.argv[1] == "quic":
u.enable_probe(probe="streams_blocked_send", fn_name="trace_streams_blocked_send")
u.enable_probe(probe="streams_blocked_receive", fn_name="trace_streams_blocked_receive")
u.enable_probe(probe="data_blocked_receive", fn_name="trace_data_blocked_receive")
+ u.enable_probe(probe="stream_data_blocked_receive", fn_name="trace_stream_data_blocked_receive")
b = BPF(text=quic_bpf, usdt_contexts=[u])
else:
u.enable_probe(probe="receive_request", fn_name="trace_receive_req")
