# munlock ____________________________________________________
# long sys_munlock(unsigned long start, size_t len)

@define _SYSCALL_MUNLOCK_NAME
%(
	name = "munlock"
%)

@define _SYSCALL_MUNLOCK_ARGSTR
%(
	argstr = sprintf("%p, %d", addr, len)
%)

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

# dw_munlock _____________________________________________________

probe dw_syscall.munlock = kernel.function("sys_munlock").call ?
{
	@_SYSCALL_MUNLOCK_NAME
	addr = $start
	len = $len
	@_SYSCALL_MUNLOCK_ARGSTR
}
probe dw_syscall.munlock.return = kernel.function("sys_munlock").return ?
{
	@_SYSCALL_MUNLOCK_NAME
	retstr = return_str(1, $return)
}

# nd_munlock _____________________________________________________

probe nd_syscall.munlock = kprobe.function("sys_munlock") ?
{
	@_SYSCALL_MUNLOCK_NAME
	asmlinkage()
	addr = ulong_arg(1)
	len = ulong_arg(2)
	@_SYSCALL_MUNLOCK_ARGSTR
}
probe nd_syscall.munlock.return = kprobe.function("sys_munlock").return ?
{
	@_SYSCALL_MUNLOCK_NAME
	retstr = returnstr(1)
}
