History

tools headers UAPI: Sync sched.h with the kernel

To get the changes in: 0acefef58451 ("Merge tag 'threads-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux") 49cb2fc42ce4 ("fork: extend clone3() to support setting a PID") fa729c4df558 ("clone3: validate stack arguments") b612e5df4587 ("clone3: add CLONE_CLEAR_SIGHAND") This file gets rebuilt, but no changes ensues: CC /tmp/build/perf/trace/beauty/clone.o This addresses this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h' diff -u tools/include/uapi/linux/sched.h include/uapi/linux/sched. The CLONE_CLEAR_SIGHAND one will be used in tools/perf/trace/beauty/clone.c in a followup patch to show that string when this bit is set in the syscall arg. Keeping a copy of this file allows us to build this in older systems and have the binary support printing that flag whenever that system gets its kernel updated to one where this feature is present.

Arnaldo Carvalho de Melo committed 6 years ago

Commit 2603a491 parent 1fc3d0e1 file · +42 −18Browse files

Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all

Unified · Split

tools/include/uapi/linux/sched.h+42−18
@@ -33,27 +33,48 @@ · 32 unmodified lines
33#define CLONE_NEWNET 0x40000000 /* New network namespace */33#define CLONE_NEWNET 0x40000000 /* New network namespace */
34#define CLONE_IO 0x80000000 /* Clone io context */34#define CLONE_IO 0x80000000 /* Clone io context */
35 35
36/* Flags for the clone3() syscall. */
37#define CLONE_CLEAR_SIGHAND 0x100000000ULL /* Clear any signal handler and reset to SIG_DFL. */
38
36#ifndef __ASSEMBLY__39#ifndef __ASSEMBLY__
37/**40/**
38 * struct clone_args - arguments for the clone3 syscall41 * struct clone_args - arguments for the clone3 syscall
39 * @flags: Flags for the new process as listed above.42 * @flags: Flags for the new process as listed above.
40 * All flags are valid except for CSIGNAL and43 * All flags are valid except for CSIGNAL and
41 * CLONE_DETACHED.44 * CLONE_DETACHED.
42 * @pidfd: If CLONE_PIDFD is set, a pidfd will be45 * @pidfd: If CLONE_PIDFD is set, a pidfd will be
43 * returned in this argument.46 * returned in this argument.
44 * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the47 * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the
45 * child process will be returned in the child's48 * child process will be returned in the child's
46 * memory.49 * memory.
47 * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of50 * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of
48 * the child process will be returned in the51 * the child process will be returned in the
49 * parent's memory.52 * parent's memory.
50 * @exit_signal: The exit_signal the parent process will be53 * @exit_signal: The exit_signal the parent process will be
51 * sent when the child exits.54 * sent when the child exits.
52 * @stack: Specify the location of the stack for the55 * @stack: Specify the location of the stack for the
53 * child process.56 * child process.
54 * @stack_size: The size of the stack for the child process.57 * Note, @stack is expected to point to the
55 * @tls: If CLONE_SETTLS is set, the tls descriptor58 * lowest address. The stack direction will be
56 * is set to tls.59 * determined by the kernel and set up
60 * appropriately based on @stack_size.
61 * @stack_size: The size of the stack for the child process.
62 * @tls: If CLONE_SETTLS is set, the tls descriptor
63 * is set to tls.
64 * @set_tid: Pointer to an array of type *pid_t. The size
65 * of the array is defined using @set_tid_size.
66 * This array is used to select PIDs/TIDs for
67 * newly created processes. The first element in
68 * this defines the PID in the most nested PID
69 * namespace. Each additional element in the array
70 * defines the PID in the parent PID namespace of
71 * the original PID namespace. If the array has
72 * less entries than the number of currently
73 * nested PID namespaces only the PIDs in the
74 * corresponding namespaces are set.
75 * @set_tid_size: This defines the size of the array referenced
76 * in @set_tid. This cannot be larger than the
77 * kernel's limit of nested PID namespaces.
57 *78 *
58 * The structure is versioned by size and thus extensible.79 * The structure is versioned by size and thus extensible.
59 * New struct members must go at the end of the struct and80 * New struct members must go at the end of the struct and
@@ -68,10 +89,13 @@ struct clone_args { · 8 unmodified lines
68 __aligned_u64 stack;89 __aligned_u64 stack;
69 __aligned_u64 stack_size;90 __aligned_u64 stack_size;
70 __aligned_u64 tls;91 __aligned_u64 tls;
92 __aligned_u64 set_tid;
93 __aligned_u64 set_tid_size;
71};94};
72#endif95#endif
73 96
74#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */97#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */
98#define CLONE_ARGS_SIZE_VER1 80 /* sizeof second published struct */
75 99
76/*100/*
77 * Scheduling policies101 * Scheduling policies