4 * Not defined anywhere else, probably, just to make sure we
7 #define SCHED_POLICY_MASK 0xff
10 #define SCHED_DEADLINE 6
13 static size_t syscall_arg__scnprintf_sched_policy(char *bf, size_t size,
14 struct syscall_arg *arg)
16 const char *policies[] = {
17 "NORMAL", "FIFO", "RR", "BATCH", "ISO", "IDLE", "DEADLINE",
20 int policy = arg->val,
21 flags = policy & ~SCHED_POLICY_MASK;
23 policy &= SCHED_POLICY_MASK;
24 if (policy <= SCHED_DEADLINE)
25 printed = scnprintf(bf, size, "%s", policies[policy]);
27 printed = scnprintf(bf, size, "%#x", policy);
29 #define P_POLICY_FLAG(n) \
30 if (flags & SCHED_##n) { \
31 printed += scnprintf(bf + printed, size - printed, "|%s", #n); \
32 flags &= ~SCHED_##n; \
35 P_POLICY_FLAG(RESET_ON_FORK);
39 printed += scnprintf(bf + printed, size - printed, "|%#x", flags);
44 #define SCA_SCHED_POLICY syscall_arg__scnprintf_sched_policy