# sched_rr_get_interval ______________________________________
#
# long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
#

@define _SYSCALL_SCHED_RR_GET_INTERVAL_NAME
%(
	name = "sched_rr_get_interval"
%)

@define _SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR
%(
	argstr = sprintf("%d, %p", pid, tp_uaddr)
%)

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

# dw_sched_rr_get_interval _____________________________________________________

probe dw_syscall.sched_rr_get_interval = __syscall.sched_rr_get_interval,
	kernel.function("compat_sys_sched_rr_get_interval").call ?,
	kernel.function("sys32_sched_rr_get_interval").call ?
{
	@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME
	pid = __int32($pid)
	tp_uaddr = @__pointer($interval)
	@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR
}
probe __syscall.sched_rr_get_interval =
	kernel.function("sys_sched_rr_get_interval").call
{
	@__syscall_gate(@const("__NR_sched_rr_get_interval"))
}
probe dw_syscall.sched_rr_get_interval.return =
	__syscall.sched_rr_get_interval.return,
	kernel.function("compat_sys_sched_rr_get_interval").return ?,
	kernel.function("sys32_sched_rr_get_interval").return ?
{
	@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME
	retstr = return_str(1, $return)
}
probe __syscall.sched_rr_get_interval.return =
	kernel.function("sys_sched_rr_get_interval").return
{
	@__syscall_gate(@const("__NR_sched_rr_get_interval"))
}

# nd_sched_rr_get_interval _____________________________________________________

probe nd_syscall.sched_rr_get_interval = __nd_syscall.sched_rr_get_interval,
	kprobe.function("compat_sys_sched_rr_get_interval").call ?,
	kprobe.function("sys32_sched_rr_get_interval").call ?
{
	@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME
	asmlinkage()
	pid = int_arg(1)
	tp_uaddr = pointer_arg(2)
	@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR
}
probe __nd_syscall.sched_rr_get_interval =
	kprobe.function("sys_sched_rr_get_interval").call
{
	@__syscall_gate(@const("__NR_sched_rr_get_interval"))
}
probe nd_syscall.sched_rr_get_interval.return =
	__nd_syscall.sched_rr_get_interval.return,
	kprobe.function("compat_sys_sched_rr_get_interval").return ?,
	kprobe.function("sys32_sched_rr_get_interval").return ?
{
	@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME
	retstr = returnstr(1)
}
probe __nd_syscall.sched_rr_get_interval.return =
	kprobe.function("sys_sched_rr_get_interval").return
{
	@__syscall_gate(@const("__NR_sched_rr_get_interval"))
}
