# chroot _____________________________________________________
# long sys_chroot(const char __user * filename)

@define _SYSCALL_CHROOT_NAME
%(
	name = "chroot"
%)

@define _SYSCALL_CHROOT_ARGSTR
%(
	argstr = path
%)

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

# dw_chroot _____________________________________________________

probe dw_syscall.chroot = kernel.function("sys_chroot").call
{
	@_SYSCALL_CHROOT_NAME
	path = user_string_quoted($filename)
	@_SYSCALL_CHROOT_ARGSTR
}
probe dw_syscall.chroot.return = kernel.function("sys_chroot").return
{
	@_SYSCALL_CHROOT_NAME
	retstr = return_str(1, $return)
}

# nd_chroot _____________________________________________________

probe nd_syscall.chroot = kprobe.function("sys_chroot") ?
{
	@_SYSCALL_CHROOT_NAME
	asmlinkage()
	path = user_string_quoted(pointer_arg(1))
	@_SYSCALL_CHROOT_ARGSTR
}
probe nd_syscall.chroot.return = kprobe.function("sys_chroot").return ?
{
	@_SYSCALL_CHROOT_NAME
	retstr = returnstr(1)
}
