Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[opentitantool] Multi-byte read()/write() in serial console
The serial console library suffers from the need not to consume any additional bytes, if one of the regular expressions matches, for which we have found no better solution than to read a single byte at a time. At Google, we often use `opentitantool console` and pipe the output into other test scripts (which may do regular expressions). In such cases, the opentitanlib is not performing any regular expression matching, but it still reading a single byte at a time, and writing each byte using a separate `write()` operating system call. This is highly inefficient, when the data goes through anonymous pipes, and is often further processed just one or a few bytes at a time by other processes. This CL modifies the logic in `uart/console.rs` to recognize the case of there not being any regular expressions to match, and in that case read up to 1024 bytes at a time from the transport USB device. I plan on combining this with below enhancements to HyperDebug firmware, to make it preferably compose USB packets with multiple characters captured on its UARTs. https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/6020315 Change-Id: I4958a891c842a82d20de1d323a69d5510d3f812e Signed-off-by: Jes B. Klinke <[email protected]>
- Loading branch information