[PATCH v3 3/3] Add tests for the -l/--syscall-limit option

Sahil Siddiq icegambit91 at gmail.com
Thu Mar 2 19:30:23 UTC 2023


On Thursday, 2 March 2023 06:15:43 IST Dmitry V. Levin wrote:
> On Thu, Mar 02, 2023 at 03:08:44AM +0530, Sahil Siddiq wrote:
> [...]
> > +		int pid = getpid();
> > +		chdir(".");
> > +
> > +		printf("%-5u getpid() = %d\n", pid, pid);
> > +		puts(" <detached ...>");
> Note that " <detached ...>" is not prefixed by pid so there is no way
> to tell the pid of process that has been detached.
> In other words, this expected output demonstrates an inconsistency
> in the output produced by this new option.

In the codebase, I noticed that "Process %u detached" is being printed
using error_msg() which explicitly sends the output to stderr. Syscall
decodings, on the other hand, are printed to tcp->outf. So, when using
strace with the -o option, the  "Process %u detached" is not printed to
the file.

In the tests that I have written for the -l option, when run_strace() is
called in init.sh, the "Process %u detached" line will not be printed to

Is it alright if these lines are omitted in $LOG when running the tests?


More information about the Strace-devel mailing list