2015-12-17 20:56:48 +03:00
/*
* Copyright ( c ) 2012 Denys Vlasenko < vda . linux @ googlemail . com >
* Copyright ( c ) 2012 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2018-12-25 02:46:43 +03:00
* Copyright ( c ) 2014 - 2018 The strace developers .
2015-12-17 20:56:48 +03:00
* All rights reserved .
*
2018-12-10 03:00:00 +03:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2015-12-17 20:56:48 +03:00
*/
2014-12-11 22:21:54 +03:00
# include "defs.h"
2015-04-07 04:36:50 +03:00
SYS_FUNC ( process_vm_readv )
2014-12-11 22:21:54 +03:00
{
if ( entering ( tcp ) ) {
/* arg 1: pid */
2016-10-14 18:42:36 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
2014-12-11 22:21:54 +03:00
} else {
2016-12-26 13:26:03 +03:00
kernel_ulong_t local_iovcnt = tcp - > u_arg [ 2 ] ;
kernel_ulong_t remote_iovcnt = tcp - > u_arg [ 4 ] ;
kernel_ulong_t flags = tcp - > u_arg [ 5 ] ;
2016-10-15 02:54:39 +03:00
2014-12-11 22:21:54 +03:00
/* arg 2: local iov */
2016-10-15 02:54:39 +03:00
tprint_iov_upto ( tcp , local_iovcnt , tcp - > u_arg [ 1 ] ,
2016-10-15 02:57:47 +03:00
syserror ( tcp ) ? IOV_DECODE_ADDR : IOV_DECODE_STR ,
tcp - > u_rval ) ;
2014-12-11 22:21:54 +03:00
/* arg 3: local iovcnt */
2016-12-26 13:16:35 +03:00
tprintf ( " , % " PRI_klu " , " , local_iovcnt ) ;
2014-12-11 22:21:54 +03:00
/* arg 4: remote iov */
2016-10-15 02:54:39 +03:00
tprint_iov ( tcp , remote_iovcnt , tcp - > u_arg [ 3 ] ,
2016-10-15 02:57:47 +03:00
IOV_DECODE_ADDR ) ;
2014-12-11 22:21:54 +03:00
/* arg 5: remote iovcnt */
/* arg 6: flags */
2016-12-26 13:16:35 +03:00
tprintf ( " , % " PRI_klu " , % " PRI_klu , remote_iovcnt , flags ) ;
2014-12-11 22:21:54 +03:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( process_vm_writev )
2014-12-11 22:21:54 +03:00
{
2016-12-26 13:26:03 +03:00
kernel_ulong_t local_iovcnt = tcp - > u_arg [ 2 ] ;
kernel_ulong_t remote_iovcnt = tcp - > u_arg [ 4 ] ;
kernel_ulong_t flags = tcp - > u_arg [ 5 ] ;
2016-10-15 02:54:39 +03:00
2015-07-17 23:39:49 +03:00
/* arg 1: pid */
2016-10-14 18:42:36 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
2015-07-17 23:39:49 +03:00
/* arg 2: local iov */
2016-10-15 02:54:39 +03:00
tprint_iov ( tcp , local_iovcnt , tcp - > u_arg [ 1 ] , IOV_DECODE_STR ) ;
2015-07-17 23:39:49 +03:00
/* arg 3: local iovcnt */
2016-12-26 13:16:35 +03:00
tprintf ( " , % " PRI_klu " , " , local_iovcnt ) ;
2015-07-17 23:39:49 +03:00
/* arg 4: remote iov */
2016-10-15 02:54:39 +03:00
tprint_iov ( tcp , remote_iovcnt , tcp - > u_arg [ 3 ] , IOV_DECODE_ADDR ) ;
2015-07-17 23:39:49 +03:00
/* arg 5: remote iovcnt */
/* arg 6: flags */
2016-12-26 13:16:35 +03:00
tprintf ( " , % " PRI_klu " , % " PRI_klu , remote_iovcnt , flags ) ;
2015-07-17 23:39:49 +03:00
return RVAL_DECODED ;
2014-12-11 22:21:54 +03:00
}