Gabriele Monaco <[email protected]> writes:
> +/*
> + * Dummy values if not available
> + */
> +#ifndef __NR_sched_setscheduler
> +#define __NR_sched_setscheduler -1
> +#endif
> +#ifndef __NR_sched_setattr
> +#define __NR_sched_setattr -2
> +#endif
You can use __COUNTER__ intead, would make it easier to add to or remove
from this list later on.
> +static void handle_syscall(void *data, struct pt_regs *regs, long id)
> +{
> + struct task_struct *p;
> + int new_policy = -1;
> +
> + new_policy = extract_params(regs, id, &p);
> + if (new_policy < 0 || new_policy == p->policy)
> + return;
> + if (p->policy == SCHED_DEADLINE)
> + da_reset(EXPAND_ID(&p->dl, DL_TASK));
> + else if (new_policy == SCHED_DEADLINE)
> + da_create_conditional(EXPAND_ID(&p->dl, DL_TASK), GFP_NOWAIT);
> +}
What if the syscall fails for any reason? Wouldn't the monitor stores
incorrect information?
Nam