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

Dmitry V. Levin ldv at strace.io
Fri Mar 3 08:59:55 UTC 2023


On Fri, Mar 03, 2023 at 11:55:45AM +0530, Sahil Siddiq wrote:
> On Friday, 3 March 2023 01:20:23 IST Dmitry V. Levin wrote:
> > [...]
> > > 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
> > > $LOG.
> > > 
> > > Is it alright if these lines are omitted in $LOG when running the tests?
> > 
> > Wh at these messages describe is not something the tracee is doing but what
> > strace is doing to the tracee, so I think it's correct these messages are
> > not going to the tracee log.  Let's say strace -ff -o $LOG -l $limit
> > is invoked, would it make sense to add the diagnostics about detaching
> > to every log file?  I don't think so.
> > 
> > Checking for these messages is one of possible methods to check that the
> > tracees were detached, but I suppose it's not the only way to check this.
> 
> The other idea I have for checking whether the tracees were detached is to save
> what strace's output would have been had it not been used with the -l option in
> a file (for eg, save that output in a file called "set_nolimit"). And then the actual
> output with the -l option can be saved in another file (eg: "set_limit"). Then one
> could compare "set_limit" with "set_nolimit | head -l $limit".

It doesn't have to be that complicated.  I think all you need is to
prepare the executable that issues more traced syscalls, so that the
output of strace without --syscall-limit would be different.  What's more
tricky is to check that the tracees are actually running after detachment,
and not killed or stopped.  For example, they could do some visible side
effect after being detached, e.g. create a file, so the test could check
that.


-- 
ldv


More information about the Strace-devel mailing list