| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: LGPL-2.1 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * trace/beauty/cone.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * Released under the GPL v2. (and only v2, not any later version) |
|---|
| 7 | 6 | */ |
|---|
| 8 | 7 | |
|---|
| 9 | 8 | #include "trace/beauty/beauty.h" |
|---|
| .. | .. |
|---|
| 11 | 10 | #include <sys/types.h> |
|---|
| 12 | 11 | #include <uapi/linux/sched.h> |
|---|
| 13 | 12 | |
|---|
| 14 | | -static size_t clone__scnprintf_flags(unsigned long flags, char *bf, size_t size) |
|---|
| 13 | +static size_t clone__scnprintf_flags(unsigned long flags, char *bf, size_t size, bool show_prefix) |
|---|
| 15 | 14 | { |
|---|
| 15 | + const char *prefix = "CLONE_"; |
|---|
| 16 | 16 | int printed = 0; |
|---|
| 17 | 17 | |
|---|
| 18 | 18 | #define P_FLAG(n) \ |
|---|
| 19 | 19 | if (flags & CLONE_##n) { \ |
|---|
| 20 | | - printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \ |
|---|
| 20 | + printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \ |
|---|
| 21 | 21 | flags &= ~CLONE_##n; \ |
|---|
| 22 | 22 | } |
|---|
| 23 | 23 | |
|---|
| .. | .. |
|---|
| 25 | 25 | P_FLAG(FS); |
|---|
| 26 | 26 | P_FLAG(FILES); |
|---|
| 27 | 27 | P_FLAG(SIGHAND); |
|---|
| 28 | + P_FLAG(PIDFD); |
|---|
| 28 | 29 | P_FLAG(PTRACE); |
|---|
| 29 | 30 | P_FLAG(VFORK); |
|---|
| 30 | 31 | P_FLAG(PARENT); |
|---|
| .. | .. |
|---|
| 44 | 45 | P_FLAG(NEWPID); |
|---|
| 45 | 46 | P_FLAG(NEWNET); |
|---|
| 46 | 47 | P_FLAG(IO); |
|---|
| 48 | + P_FLAG(CLEAR_SIGHAND); |
|---|
| 49 | + P_FLAG(INTO_CGROUP); |
|---|
| 47 | 50 | #undef P_FLAG |
|---|
| 48 | 51 | |
|---|
| 49 | 52 | if (flags) |
|---|
| .. | .. |
|---|
| 71 | 74 | if (!(flags & CLONE_SETTLS)) |
|---|
| 72 | 75 | arg->mask |= SCC_TLS; |
|---|
| 73 | 76 | |
|---|
| 74 | | - return clone__scnprintf_flags(flags, bf, size); |
|---|
| 77 | + return clone__scnprintf_flags(flags, bf, size, arg->show_string_prefix); |
|---|
| 75 | 78 | } |
|---|