[PATCH v3 2/3] The -z and -Z options print only successful and failing syscalls respectively. However, failure of syscall is only known after syscall return. Thus, we end up with something like this on, e.g., ENOENT:

Paul Chaignon paul.chaignon at gmail.com
Wed May 22 08:12:35 UTC 2019


Thanks for the review!  I'll be sending the v4.

On Wed, May 22, 2019 at 05:23AM, Dmitry V. Levin wrote:
> On Thu, Apr 25, 2019 at 04:22:36PM +0200, burkhard.kohl at intel.com wrote:
> [...]
> > @@ -753,6 +757,15 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
> >  	if (raw(tcp)) {
> >  		/* sys_res = printargs(tcp); - but it's nop on sysexit */
> >  	} else {
> 
> This doesn't look correct: -z/-Z should apply to raw(tcp) case as well.
> 
> > +#if HAVE_OPEN_MEMSTREAM
> > +		if ((not_failing_only && syserror(tcp)) ||
> > +			(failing_only && !syserror(tcp))) {
> > +			line_ended();
> > +			strace_close_memstream(tcp, true);
> > +			return 0;   /* ignore failed/successful
> > +						 * syscalls */
> > +		}
> > +#else
> >  	/* FIXME: not_failing_only (IOW, option -z) is broken:
> >  	 * failure of syscall is known only after syscall return.
> >  	 * Thus we end up with something like this on, say, ENOENT:
> 
> I suggest to reject -z/-Z options when open_memstream is not available
> and remove all !HAVE_OPEN_MEMSTREAM code.

Are you suggesting we keep the new "struct tcb" fields regardless of
whether open_memstream is available and they are actually used?

Should we still expose and document the -z/-Z options when open_memstream
is not available (and error on any actual usage)?  That seems clearer for
the users.

> 
> 
> -- 
> ldv



> -- 
> Strace-devel mailing list
> Strace-devel at lists.strace.io
> https://lists.strace.io/mailman/listinfo/strace-devel



More information about the Strace-devel mailing list