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