# delete_module ______________________________________________
# long sys_delete_module(const char __user *name_user, unsigned int flags)

@define _SYSCALL_DELETE_MODULE_NAME
%(
	name = "delete_module"
%)

@define _SYSCALL_DELETE_MODULE_ARGSTR
%(
	argstr = sprintf("%s, %s", name_user, _module_flags_str(flags))
%)

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

# dw_delete_module _____________________________________________________

probe dw_syscall.delete_module = kernel.function("sys_delete_module").call ?
{
	@_SYSCALL_DELETE_MODULE_NAME
	name_user = user_string_quoted($name_user)
	flags = __uint32($flags)
	flags_str = _module_flags_str(__uint32($flags))
	@_SYSCALL_DELETE_MODULE_ARGSTR
}
probe dw_syscall.delete_module.return =
	kernel.function("sys_delete_module").return ?
{
	@_SYSCALL_DELETE_MODULE_NAME
	retstr = return_str(1, $return)
}

# nd_delete_module _____________________________________________________

probe nd_syscall.delete_module = kprobe.function("sys_delete_module") ?
{
	@_SYSCALL_DELETE_MODULE_NAME
	asmlinkage()
	name_user = user_string_quoted(pointer_arg(1))
	flags = uint_arg(2)
	flags_str = _module_flags_str(flags)
	@_SYSCALL_DELETE_MODULE_ARGSTR
}
probe nd_syscall.delete_module.return =
	kprobe.function("sys_delete_module").return ?
{
	@_SYSCALL_DELETE_MODULE_NAME
	retstr = returnstr(1)
}
