[PATCH] Add decoding of sockets descriptor 'paths' for network calls.

Dmitry V. Levin ldv at altlinux.org
Sat Feb 1 00:01:40 UTC 2014


On Fri, Jan 31, 2014 at 05:48:40AM -0800, Philippe Ombredanne wrote:
[...]
> @@ -339,11 +339,13 @@ pathtrace_match(struct tcb *tcp)
>  	    s->sys_func == sys_timerfd_settime ||
>  	    s->sys_func == sys_timerfd_gettime ||
>  	    s->sys_func == sys_epoll_create ||
> +        s->sys_func == sys_socket ||
> +        s->sys_func == sys_socketpair ||

Something went wrong with indentation here.

>  	    strcmp(s->sys_name, "fanotify_init") == 0)
>  	{
>  		/*
> -		 * These have TRACE_FILE or TRACE_DESCRIPTOR set, but they
> -		 * don't have any file descriptor or path args to test.
> +		 * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set, 

Trailing whitespace characters are not welcome. ;)

> @@ -359,5 +361,8 @@ pathtrace_match(struct tcb *tcp)
>  	if (s->sys_flags & TRACE_DESC)
>  		return fdmatch(tcp, tcp->u_arg[0]);
>  
> +	if (s->sys_flags & TRACE_NETWORK)
> +		return fdmatch(tcp, tcp->u_arg[0]);

I suggest merging this test with TRACE_DESC test above.

>  TESTS = ptrace_setoptions strace-f qual_syscall sigaction.sh stat net \
> -	detach-sleeping detach-stopped detach-running
> +	detach-sleeping detach-stopped detach-running net-fd

The order of tests is important, so please add "net-fd" right after "net".

> +check_prog grep
> +check_prog rm

strace -y is implemented using /proc/self/fd, so please add a test, e.g.
	[ -d /proc/self/fd/ ] ||
		framework_skip_ '/proc/self/fd/ is not available'

All the rest looks OK.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140201/d6216006/attachment.bin>


More information about the Strace-devel mailing list