summaryrefslogtreecommitdiff
path: root/src/til_args.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-06-12 17:15:54 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-06-12 17:15:54 -0700
commitf806bf55ee2ada32b2fe9d4a13ccc84552d379d1 (patch)
tree2017a2cf0c9ec1a97e8faaab508344f16cba3600 /src/til_args.c
parent8fdd84d2c743b19ad1ca73c2065f87a09e797377 (diff)
til_args: introduce --print-module-contexts
Some rudimentary instrumentation for monitoring the active module contexts alongside the pipes You probably want to redirect stderr to a file when using --print-pipes and/or --print-module-contexts... e.g. ``` rototiller --defaults --go --print-pipes --print-module-contexts 2>/dev/null ``` or, if you still want to monitor FPS or log_channels=on in rtv, 2>/file/to/tail then tail -F /file/to/tail in another terminal.
Diffstat (limited to 'src/til_args.c')
-rw-r--r--src/til_args.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/til_args.c b/src/til_args.c
index 11f2487..7e4c7e6 100644
--- a/src/til_args.c
+++ b/src/til_args.c
@@ -13,6 +13,7 @@
* ./rototiller --go // don't show args and wait for user input before proceeding
* ./rototiller --seed=0xdeadbeef // explicitly set global random seed instead of generating one
* ./rototiller --print-pipes // print values for the pipes every frame
+ * ./rototiller --print-module-contexts // print information about registered module contexts every frame
*
* unrecognized arguments trigger an -EINVAL error, unless res_{argc,argv} are non-NULL
* where a new argv will be allocated and populated with the otherwise invalid arguments
@@ -55,6 +56,8 @@ static int args_parse(int argc, const char *argv[], til_args_t *res_args, int *r
res_args->help = 1;
} else if (!strcasecmp("--go", argv[i])) {
res_args->gogogo = 1;
+ } else if (!strcasecmp("--print-module-contexts", argv[i])) {
+ res_args->print_module_contexts = 1;
} else if (!strcasecmp("--print-pipes", argv[i])) {
res_args->print_pipes = 1;
} else {
@@ -87,11 +90,13 @@ int til_args_parse(int argc, const char *argv[], til_args_t *res_args)
int til_args_help(FILE *out)
{
return fprintf(out,
- " --defaults use defaults for unspecified settings\n"
- " --go start rendering immediately upon fulfilling all required settings\n"
- " --help this help\n"
- " --module= module settings\n"
- " --seed= seed to use for all PRNG in hexadecimal (e.g. 0xdeadbeef)\n"
- " --video= video settings\n"
+ " --defaults use defaults for unspecified settings\n"
+ " --go start rendering immediately upon fulfilling all required settings\n"
+ " --help this help\n"
+ " --module= module settings\n"
+ " --print-module-contexts print active contexts on-stream to stdout\n"
+ " --print-pipes print active pipes on-stream to stdout\n"
+ " --seed= seed to use for all PRNG in hexadecimal (e.g. 0xdeadbeef)\n"
+ " --video= video settings\n"
);
}
© All Rights Reserved