From daa8d129c1b9d089aa622c0874f9d1a8c8b9cc6d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 21 Nov 2020 13:25:56 +0100 Subject: pgo: feed VT data through fdm_ptmx(), not vt_from_slave() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fdm_ptmx(), the FDM callback handler for ptmx data, is just as much in the hot path as vt_from_slave(). It is also slightly more complicated than a read() followed by a call to vt_from_slave(). As a result, some benchmarks performed significantly worse in a partial PGO build than in a full PGO build, since fdm_ptmx() wasn’t PGO:d. To be able to feed data through fdm_ptmx(), we need to set up the delayed rendering timer FDs, configure the timeout values, and provide a readable FD it can read the VT data from. The latter is done with a memory FD. This ensures *all* VT data is loaded into memory before we feed it to the parser. --- terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 2c5e0a85..f78e103c 100644 --- a/terminal.c +++ b/terminal.c @@ -198,7 +198,9 @@ fdm_ptmx_out(struct fdm *fdm, int fd, int events, void *data) static struct timespec last = {0}; #endif -static bool +/* Externally visible, but not declared in terminal.h, to enable pgo + * to call this function directly */ +bool fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) { struct terminal *term = data; -- cgit v1.3