trace-run formats a tracing message according to the <format> string and a list of variable-type <expression>s (in the same way C's printf() does) and then writes the result into current process' trace_file (if enabled, see vv
) without any encoding (meaning a string is output exactly as it is).
trace-run can be used without any clauses, in which case a location (file name and line number) is recorded in the trace file - this is useful when you only want to know if the execution passed through code.
If trace-run has any other clauses, then <format> string must be present and there must be at least one <expression> (it means if you want to trace a simple string literal you still have to use "%s" as format).
For tracing to have effect, tracing must be enabled (see vv
). For location of trace files, see how_vely_works
trace-run "Program wrote %lld bytes into file %s", num_bytes, file_name
for an example in debugging and tracing.