| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +// SPDX-License-Identifier: LGPL-2.1 |
|---|
| 2 | 2 | #include <sched.h> |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | /* |
|---|
| .. | .. |
|---|
| 17 | 17 | static size_t syscall_arg__scnprintf_sched_policy(char *bf, size_t size, |
|---|
| 18 | 18 | struct syscall_arg *arg) |
|---|
| 19 | 19 | { |
|---|
| 20 | + bool show_prefix = arg->show_string_prefix; |
|---|
| 21 | + const char *prefix = "SCHED_"; |
|---|
| 20 | 22 | const char *policies[] = { |
|---|
| 21 | 23 | "NORMAL", "FIFO", "RR", "BATCH", "ISO", "IDLE", "DEADLINE", |
|---|
| 22 | 24 | }; |
|---|
| .. | .. |
|---|
| 26 | 28 | |
|---|
| 27 | 29 | policy &= SCHED_POLICY_MASK; |
|---|
| 28 | 30 | if (policy <= SCHED_DEADLINE) |
|---|
| 29 | | - printed = scnprintf(bf, size, "%s", policies[policy]); |
|---|
| 31 | + printed = scnprintf(bf, size, "%s%s", show_prefix ? prefix : "", policies[policy]); |
|---|
| 30 | 32 | else |
|---|
| 31 | 33 | printed = scnprintf(bf, size, "%#x", policy); |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | #define P_POLICY_FLAG(n) \ |
|---|
| 34 | 36 | if (flags & SCHED_##n) { \ |
|---|
| 35 | | - printed += scnprintf(bf + printed, size - printed, "|%s", #n); \ |
|---|
| 37 | + printed += scnprintf(bf + printed, size - printed, "|%s%s", show_prefix ? prefix : "", #n); \ |
|---|
| 36 | 38 | flags &= ~SCHED_##n; \ |
|---|
| 37 | 39 | } |
|---|
| 38 | 40 | |
|---|