Skip to content

Commit

Permalink
add probe to see what has actually been sent
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Jan 29, 2025
1 parent 91542af commit ebcfde2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -4348,6 +4348,14 @@ quicly_error_t quicly_send_stream(quicly_stream_t *stream, quicly_send_context_t
is_fin = 0;
}

QUICLY_PROBE(STREAM_AFTER_SEND_EMIT, stream->conn, stream->conn->stash.now, stream, *s->dst, off, dst, len);
QUICLY_LOG_CONN(stream_after_send_emit, stream->conn, {
PTLS_LOG_ELEMENT_SIGNED(stream_id, stream->stream_id);
PTLS_LOG_ELEMENT_UNSIGNED(frame_type, *s->dst);
PTLS_LOG_ELEMENT_UNSIGNED(frame_offset, off);
PTLS_LOG_APPDATA_ELEMENT_HEXDUMP(data, dst - len, len);
});

/* update s->dst now that frame construction is complete */
s->dst = dst;

Expand Down
2 changes: 2 additions & 0 deletions quicly-probes.d
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ provider quicly {
probe stream_on_send_shift(struct st_quicly_conn_t *conn, int64_t at, struct st_quicly_stream_t *stream, size_t delta);
probe stream_on_send_emit(struct st_quicly_conn_t *conn, int64_t at, struct st_quicly_stream_t *stream, size_t off,
size_t capacity);
probe stream_after_send_emit(struct st_quicly_conn_t *conn, int64_t at, struct st_quicly_stream_t *stream, uint8_t frame_type,
uint64_t frame_offset, const void *data, size_t data_len);
probe stream_on_send_stop(struct st_quicly_conn_t *conn, int64_t at, struct st_quicly_stream_t *stream, int64_t err);
probe stream_on_receive(struct st_quicly_conn_t *conn, int64_t at, struct st_quicly_stream_t *stream, size_t off,
const void *src, size_t src_len);
Expand Down

0 comments on commit ebcfde2

Please sign in to comment.