power: supply: bq24190_charger: Add disable-reset device-property
[linux/fpc-iii.git] / tools / perf / trace / beauty / sched_policy.c
blob34775295b9b37ae8ddd9976e11c6e7abcf5db9b8
1 #include <sched.h>
3 /*
4 * Not defined anywhere else, probably, just to make sure we
5 * catch future flags
6 */
7 #define SCHED_POLICY_MASK 0xff
9 #ifndef SCHED_DEADLINE
10 #define SCHED_DEADLINE 6
11 #endif
12 #ifndef SCHED_RESET_ON_FORK
13 #define SCHED_RESET_ON_FORK 0x40000000
14 #endif
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",
22 size_t printed;
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]);
29 else
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);
39 #undef P_POLICY_FLAG
41 if (flags)
42 printed += scnprintf(bf + printed, size - printed, "|%#x", flags);
44 return printed;
47 #define SCA_SCHED_POLICY syscall_arg__scnprintf_sched_policy