diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-07-08 20:20:22 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-07-08 21:22:29 -0700 |
commit | 8132787168fa57da870edfb816589588d4620e1b (patch) | |
tree | 9042ae650b8f9826f2c323339d9e69d1852cfbba /src/til_stream.c | |
parent | 4bad0667dd6ddfa1a43339ae37b3535550e8e264 (diff) |
til: measure til_module_render() durations
This stows the duration (in ticks (which are ms for now)) of a
given module context's most recent, as well as tracking the max,
in til_module_context_t.
For now it's also added to --print-module-contexts output, but
this is still rather primitive and nearly inscrutible in
practice... that output is a flickery and unsorted mess during
playback. But this is just a start.
Ticks may need to move up to microseconds if it'll also be the
units for measuring timings. Right now things are slow enough
that the low-hanging fruit stand out as multiple if not dozens of
milliseconds so it's still useful for now.
Diffstat (limited to 'src/til_stream.c')
-rw-r--r-- | src/til_stream.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/til_stream.c b/src/til_stream.c index a28e138..0ff988c 100644 --- a/src/til_stream.c +++ b/src/til_stream.c @@ -696,8 +696,16 @@ static int til_stream_fprint_module_context_cb(void *arg, til_stream_module_cont FILE *out = arg; fprintf(out, " %s: %s[%zu]", contexts[0]->setup->path, contexts[0]->module->name, n_module_contexts); - for (size_t i = 0; i < n_module_contexts; i++) - fprintf(out, "%s{rc=%u, n_cpus=%u}", i ? ", " : " ", contexts[i]->refcount, contexts[i]->n_cpus); + for (size_t i = 0; i < n_module_contexts; i++) { + fprintf(out, + "%s{rc=%u, n_cpus=%u r=%u rd=%u maxrd=%u}", + i ? ", " : " ", + contexts[i]->refcount, + contexts[i]->n_cpus, + contexts[i]->renders_count, + contexts[i]->last_render_duration, + contexts[i]->max_render_duration); + } fprintf(out, "\n"); return 0; |