# sched_getscheduler _________________________________________
#
# long sys_sched_getscheduler(pid_t pid)
#

@define _SYSCALL_SCHED_GETSCHEDULER_NAME
%(
	name = "sched_getscheduler"
%)

@define _SYSCALL_SCHED_GETSCHEDULER_ARGSTR
%(
	argstr = sprint(pid)
%)

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

# dw_sched_getscheduler _____________________________________________________

probe dw_syscall.sched_getscheduler = kernel.function("sys_sched_getscheduler").call
{
	@_SYSCALL_SCHED_GETSCHEDULER_NAME
	pid = __int32($pid)
	@_SYSCALL_SCHED_GETSCHEDULER_ARGSTR
}
probe dw_syscall.sched_getscheduler.return = kernel.function("sys_sched_getscheduler").return
{
	@_SYSCALL_SCHED_GETSCHEDULER_NAME
	retstr = return_str(1, $return)
}

# nd_sched_getscheduler _____________________________________________________

probe nd_syscall.sched_getscheduler = kprobe.function("sys_sched_getscheduler") ?
{
	@_SYSCALL_SCHED_GETSCHEDULER_NAME
	asmlinkage()
	pid = int_arg(1)
	@_SYSCALL_SCHED_GETSCHEDULER_ARGSTR
}
probe nd_syscall.sched_getscheduler.return = kprobe.function("sys_sched_getscheduler").return ?
{
	@_SYSCALL_SCHED_GETSCHEDULER_NAME
	retstr = returnstr(1)
}
