# sys32_sendfile64 ________________________________________
#
# asmlinkage int sys32_sendfile64(int out_fd, int in_fd,
#		compat_loff_t __user *offset, s32 count)
#

@define _SYSCALL_SYS32_SENDFILE64_NAME
%(
	name = "sys32_sendfile64"
%)

@define _SYSCALL_SYS32_SENDFILE64_ARGSTR
%(
	argstr = sprintf("%d, %d, %p, %d", out_fd, in_fd, offset_uaddr, count)
%)

probe syscall.sys32_sendfile64 = dw_syscall.sys32_sendfile64 !,
                                 nd_syscall.sys32_sendfile64 ? {}
probe syscall.sys32_sendfile64.return = dw_syscall.sys32_sendfile64.return !,
                                        nd_syscall.sys32_sendfile64.return ? {}

# dw_sys32_sendfile64 _____________________________________________________

probe dw_syscall.sys32_sendfile64 = kernel.function("sys32_sendfile64") ?
{
	@_SYSCALL_SYS32_SENDFILE64_NAME
	out_fd = $out_fd
	in_fd = $in_fd
	offset_uaddr = $offset
	count = $count
	@_SYSCALL_SYS32_SENDFILE64_ARGSTR
}
probe dw_syscall.sys32_sendfile64.return = kernel.function("sys32_sendfile64").return ?
{
	@_SYSCALL_SYS32_SENDFILE64_NAME
	@SYSC_RETVALSTR($return)
}

# nd_sys32_sendfile64 _____________________________________________________

probe nd_syscall.sys32_sendfile64 = kprobe.function("sys32_sendfile64") ?
{
	@_SYSCALL_SYS32_SENDFILE64_NAME
	asmlinkage()
	out_fd = int_arg(1)
	in_fd = int_arg(2)
	offset_uaddr = long_arg(3)
	count = int_arg(4)
	@_SYSCALL_SYS32_SENDFILE64_ARGSTR
}
probe nd_syscall.sys32_sendfile64.return = kprobe.function("sys32_sendfile64").return ?
{
	@_SYSCALL_SYS32_SENDFILE64_NAME
	@SYSC_RETVALSTR(returnval())
}
