HomeFreeBSD

gdb(4): Pack 'info threads' responses into fewer packets

Description

gdb(4): Pack 'info threads' responses into fewer packets

We suffer at least one round trip ACK latency every command / packet that
GDB has to send and receive, and the response format for 'info threads'
supports packing many threads IDs into a single packet, so do so.

Adds and uses a new API, gdb_txbuf_has_capacity(), which checks for a
certain number of bytes available in the outgoing txbuf.

On an example amd64 VM, the number of RTTs to transmit this list is reduced
by a factor of 110x. This is especially beneficial with recent GDB, which
seems to request the list at least twice during attach.

Details

Provenance
cemAuthored on
Parents
rS351237: libkern: Implement strchrnul(3)
Branches
Unknown
Tags
Unknown