# alarm ______________________________________________________
# unsigned long sys_alarm (unsigned int seconds)
# long sys32_alarm(unsigned int seconds)
#

@define _SYSCALL_ALARM_NAME
%(
	name = "alarm"
%)

@define _SYSCALL_ALARM_ARGSTR
%(
	argstr = sprint(seconds)
%)

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

# dw_alarm _____________________________________________________

probe dw_syscall.alarm = kernel.function("sys32_alarm").call ?,
                      kernel.function("sys_alarm").call ?
{
	@_SYSCALL_ALARM_NAME
	seconds = __uint32($seconds)
	@_SYSCALL_ALARM_ARGSTR
}
probe dw_syscall.alarm.return = kernel.function("sys32_alarm").return ?,
                             kernel.function("sys_alarm").return ?
{
	@_SYSCALL_ALARM_NAME
	retstr = return_str(1, $return)
}

# nd_alarm _____________________________________________________

probe nd_syscall.alarm = kprobe.function("sys32_alarm") ?,
                         kprobe.function("sys_alarm") ?
{
	@_SYSCALL_ALARM_NAME
	asmlinkage()
	seconds = uint_arg(1)
	@_SYSCALL_ALARM_ARGSTR
}
probe nd_syscall.alarm.return = kprobe.function("sys32_alarm").return ?,
                                kprobe.function("sys_alarm").return ?
{
	@_SYSCALL_ALARM_NAME
	retstr = returnstr(1)
}
