Home
last modified time | relevance | path

Searched full:pid (Results 1 – 25 of 4334) sorted by relevance

12345678910>>...174

/kernel/linux/linux-5.10/include/linux/
Dpid.h19 * What is struct pid?
21 * A struct pid is the kernel's internal notion of a process identifier.
23 * there are processes attached to it the struct pid lives in a hash
25 * quickly from the numeric pid value. The attached processes may be
26 * quickly accessed by following pointers from struct pid.
29 * problem. The process originally with that pid may have exited and the
30 * pid allocator wrapped, and another process could have come along
31 * and been assigned that pid.
38 * a struct pid is about 64 bytes.
40 * Holding a reference to struct pid solves both of these problems.
[all …]
/kernel/linux/linux-6.6/include/linux/
Dpid.h19 * What is struct pid?
21 * A struct pid is the kernel's internal notion of a process identifier.
23 * there are processes attached to it the struct pid lives in a hash
25 * quickly from the numeric pid value. The attached processes may be
26 * quickly accessed by following pointers from struct pid.
29 * problem. The process originally with that pid may have exited and the
30 * pid allocator wrapped, and another process could have come along
31 * and been assigned that pid.
38 * a struct pid is about 64 bytes.
40 * Holding a reference to struct pid solves both of these problems.
[all …]
/kernel/linux/linux-6.6/kernel/
Dpid.c3 * Generic pidhash and scalable, time-bounded PID allocator
9 * pid-structures are backing objects for tasks sharing a given ID to chain
17 * We have a list of bitmap pages, which bitmaps represent the PID space.
23 * Pid namespaces:
48 struct pid init_struct_pid = {
70 * PID-map pages start out as NULL, they get allocated upon
108 void put_pid(struct pid *pid) in put_pid() argument
112 if (!pid) in put_pid()
115 ns = pid->numbers[pid->level].ns; in put_pid()
116 if (refcount_dec_and_test(&pid->count)) { in put_pid()
[all …]
/kernel/linux/linux-5.10/kernel/
Dpid.c3 * Generic pidhash and scalable, time-bounded PID allocator
9 * pid-structures are backing objects for tasks sharing a given ID to chain
17 * We have a list of bitmap pages, which bitmaps represent the PID space.
23 * Pid namespaces:
48 struct pid init_struct_pid = {
70 * PID-map pages start out as NULL, they get allocated upon
105 void put_pid(struct pid *pid) in put_pid() argument
109 if (!pid) in put_pid()
112 ns = pid->numbers[pid->level].ns; in put_pid()
113 if (refcount_dec_and_test(&pid->count)) { in put_pid()
[all …]
/kernel/liteos_a/testsuites/unittest/process/basic/process/smoke/
Dprocess_test_005.cpp35 int pid; in ProcessTest002() local
37 pid = fork(); in ProcessTest002()
38 if (pid == 0) { in ProcessTest002()
43 …ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, 100000, pid); // 100000, assert that function Result is equal t… in ProcessTest002()
45 pid = fork(); in ProcessTest002()
46 if (pid == 0) { in ProcessTest002()
51 …ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, 100000, pid); // 100000, assert that function Result is equal t… in ProcessTest002()
53 pid = fork(); in ProcessTest002()
54 if (pid == 0) { in ProcessTest002()
59 …ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, 100000, pid); // 100000, assert that function Result is equal t… in ProcessTest002()
[all …]
Dprocess_test_038.cpp51 pid_t pid, pid1; in ProcessGroup() local
59 pid = fork(); in ProcessGroup()
60 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in ProcessGroup()
62 if (pid == 0) { in ProcessGroup()
69 ICUNIT_GOTO_WITHIN_EQUAL(pid1, 0, 100000, pid1, EXIT); // 100000, assert pid equal to this. in ProcessGroup()
70 ICUNIT_GOTO_NOT_EQUAL(pid1, pid, pid1, EXIT); in ProcessGroup()
73 Child2(currGid, pid); in ProcessGroup()
87 pid_t pid, pid1; in GroupProcess() local
92 pid = fork(); in GroupProcess()
93 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in GroupProcess()
[all …]
/kernel/linux/linux-5.10/include/trace/events/
Doom.h17 __field( pid_t, pid)
23 __entry->pid = task->pid;
28 TP_printk("pid=%d comm=%s oom_score_adj=%hd",
29 __entry->pid, __entry->comm, __entry->oom_score_adj)
75 TP_PROTO(int pid),
77 TP_ARGS(pid),
80 __field(int, pid)
84 __entry->pid = pid;
87 TP_printk("pid=%d", __entry->pid)
91 TP_PROTO(int pid),
[all …]
/kernel/linux/linux-6.6/tools/testing/selftests/rlimits/
Drlimits-per-userns.c32 pid_t pid = getpid(); in setrlimit_nproc() local
38 warnx("(pid=%d): Setting RLIMIT_NPROC=%ld", pid, n); in setrlimit_nproc()
41 err(EXIT_FAILURE, "(pid=%d): setrlimit(RLIMIT_NPROC)", pid); in setrlimit_nproc()
46 pid_t pid = fork(); in fork_child() local
48 if (pid < 0) in fork_child()
51 if (pid > 0) in fork_child()
52 return pid; in fork_child()
54 pid = getpid(); in fork_child()
56 warnx("(pid=%d): New process starting ...", pid); in fork_child()
59 err(EXIT_FAILURE, "(pid=%d): prctl(PR_SET_PDEATHSIG)", pid); in fork_child()
[all …]
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/ptrace/
Dptrace-perf-hwbreak.c39 static inline long sys_ptrace(long request, pid_t pid, unsigned long addr, unsigned long data) in sys_ptrace() argument
41 return syscall(__NR_ptrace, request, pid, addr, data); in sys_ptrace()
49 static long ptrace_getregs(pid_t pid, struct pt_regs *result) in ptrace_getregs() argument
51 return sys_ptrace(PTRACE_GETREGS, pid, 0, (unsigned long)result); in ptrace_getregs()
54 static long ptrace_setregs(pid_t pid, struct pt_regs *result) in ptrace_setregs() argument
56 return sys_ptrace(PTRACE_SETREGS, pid, 0, (unsigned long)result); in ptrace_setregs()
59 static long ptrace_cont(pid_t pid, long signal) in ptrace_cont() argument
61 return sys_ptrace(PTRACE_CONT, pid, 0, signal); in ptrace_cont()
64 static long ptrace_singlestep(pid_t pid, long signal) in ptrace_singlestep() argument
66 return sys_ptrace(PTRACE_SINGLESTEP, pid, 0, signal); in ptrace_singlestep()
[all …]
/kernel/linux/linux-6.6/include/trace/events/
Doom.h19 __field( pid_t, pid)
25 __entry->pid = task->pid;
30 TP_printk("pid=%d comm=%s oom_score_adj=%hd",
31 __entry->pid, __entry->comm, __entry->oom_score_adj)
82 __field(int, pid)
94 __entry->pid = task->pid;
105 …TP_printk("pid=%d comm=%s total-vm=%lukB anon-rss=%lukB file-rss:%lukB shmem-rss:%lukB uid=%u pgta…
106 __entry->pid,
119 TP_PROTO(int pid),
121 TP_ARGS(pid),
[all …]
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/signal/
Dsigreturn_kernel.c35 pid_t pid; in fork_child() local
37 pid = fork(); in fork_child()
38 if (pid == 0) { in fork_child()
43 return pid; in fork_child()
46 static int expect_segv(pid_t pid) in expect_segv() argument
50 waitpid(pid, &child_ret, 0); in expect_segv()
62 pid_t pid; in test_sigreturn_kernel() local
73 pid = fork_child(); in test_sigreturn_kernel()
74 expect_segv(pid); in test_sigreturn_kernel()
78 pid = fork_child(); in test_sigreturn_kernel()
[all …]
/kernel/linux/linux-5.10/arch/x86/um/os-Linux/
Dregisters.c21 int save_i387_registers(int pid, unsigned long *fp_regs) in save_i387_registers() argument
23 if (ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0) in save_i387_registers()
28 int save_fp_registers(int pid, unsigned long *fp_regs) in save_fp_registers() argument
36 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in save_fp_registers()
41 return save_i387_registers(pid, fp_regs); in save_fp_registers()
44 int restore_i387_registers(int pid, unsigned long *fp_regs) in restore_i387_registers() argument
46 if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0) in restore_i387_registers()
51 int restore_fp_registers(int pid, unsigned long *fp_regs) in restore_fp_registers() argument
58 if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in restore_fp_registers()
63 return restore_i387_registers(pid, fp_regs); in restore_fp_registers()
[all …]
/kernel/linux/linux-6.6/arch/x86/um/os-Linux/
Dregisters.c22 int save_i387_registers(int pid, unsigned long *fp_regs) in save_i387_registers() argument
24 if (ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0) in save_i387_registers()
29 int save_fp_registers(int pid, unsigned long *fp_regs) in save_fp_registers() argument
37 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in save_fp_registers()
42 return save_i387_registers(pid, fp_regs); in save_fp_registers()
45 int restore_i387_registers(int pid, unsigned long *fp_regs) in restore_i387_registers() argument
47 if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0) in restore_i387_registers()
52 int restore_fp_registers(int pid, unsigned long *fp_regs) in restore_fp_registers() argument
59 if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in restore_fp_registers()
64 return restore_i387_registers(pid, fp_regs); in restore_fp_registers()
[all …]
/kernel/linux/linux-5.10/arch/powerpc/mm/book3s64/
Dradix_tlb.c30 unsigned int pid, in tlbiel_radix_set_isa300() argument
37 rs = ((unsigned long)pid << PPC_BITLSHIFT(31)); in tlbiel_radix_set_isa300()
94 static __always_inline void __tlbiel_pid(unsigned long pid, int set, in __tlbiel_pid() argument
101 rs = ((unsigned long)pid) << PPC_BITLSHIFT(31); in __tlbiel_pid()
110 static __always_inline void __tlbie_pid(unsigned long pid, unsigned long ric) in __tlbie_pid() argument
115 rs = pid << PPC_BITLSHIFT(31); in __tlbie_pid()
152 static __always_inline void __tlbiel_va(unsigned long va, unsigned long pid, in __tlbiel_va() argument
159 rs = pid << PPC_BITLSHIFT(31); in __tlbiel_va()
168 static __always_inline void __tlbie_va(unsigned long va, unsigned long pid, in __tlbie_va() argument
175 rs = pid << PPC_BITLSHIFT(31); in __tlbie_va()
[all …]
/kernel/linux/linux-6.6/arch/powerpc/mm/book3s64/
Dradix_tlb.c29 unsigned int pid, in tlbiel_radix_set_isa300() argument
36 rs = ((unsigned long)pid << PPC_BITLSHIFT(31)); in tlbiel_radix_set_isa300()
100 static __always_inline void __tlbiel_pid(unsigned long pid, int set, in __tlbiel_pid() argument
107 rs = ((unsigned long)pid) << PPC_BITLSHIFT(31); in __tlbiel_pid()
116 static __always_inline void __tlbie_pid(unsigned long pid, unsigned long ric) in __tlbie_pid() argument
121 rs = pid << PPC_BITLSHIFT(31); in __tlbie_pid()
158 static __always_inline void __tlbiel_va(unsigned long va, unsigned long pid, in __tlbiel_va() argument
165 rs = pid << PPC_BITLSHIFT(31); in __tlbiel_va()
174 static __always_inline void __tlbie_va(unsigned long va, unsigned long pid, in __tlbie_va() argument
181 rs = pid << PPC_BITLSHIFT(31); in __tlbie_va()
[all …]
/kernel/linux/linux-6.6/kernel/trace/
Dpid_list.c93 static inline int pid_split(unsigned int pid, unsigned int *upper1, in pid_split() argument
99 /* In case a bad pid is passed in, then fail */ in pid_split()
100 if (unlikely(pid >= MAX_PID)) in pid_split()
103 *upper1 = (pid >> UPPER1_SHIFT) & UPPER_MASK; in pid_split()
104 *upper2 = (pid >> UPPER2_SHIFT) & UPPER_MASK; in pid_split()
105 *lower = pid & LOWER_MASK; in pid_split()
119 * trace_pid_list_is_set - test if the pid is set in the list
120 * @pid_list: The pid list to test
121 * @pid: The pid to see if set in the list.
123 * Tests if @pid is set in the @pid_list. This is usually called
[all …]
/kernel/linux/linux-6.6/tools/testing/selftests/clone3/
Dclone3_set_tid.c6 * PID namespace.
47 pid_t pid = -1; in call_clone3_set_tid() local
56 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid()
57 if (pid < 0) { in call_clone3_set_tid()
63 if (pid == 0) { in call_clone3_set_tid()
68 ksft_print_msg("I am the child, my PID is %d (expected %d)\n", in call_clone3_set_tid()
98 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid()
99 ksft_print_msg("I am the parent (%d). My child's pid is %d\n", in call_clone3_set_tid()
100 getpid(), pid); in call_clone3_set_tid()
103 "Expected child pid %d does not match actual pid %d\n", in call_clone3_set_tid()
[all …]
/kernel/linux/linux-5.10/tools/testing/selftests/clone3/
Dclone3_set_tid.c6 * PID namespace.
47 pid_t pid = -1; in call_clone3_set_tid() local
56 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid()
57 if (pid < 0) { in call_clone3_set_tid()
63 if (pid == 0) { in call_clone3_set_tid()
68 ksft_print_msg("I am the child, my PID is %d (expected %d)\n", in call_clone3_set_tid()
98 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid()
99 ksft_print_msg("I am the parent (%d). My child's pid is %d\n", in call_clone3_set_tid()
100 getpid(), pid); in call_clone3_set_tid()
103 "Expected child pid %d does not match actual pid %d\n", in call_clone3_set_tid()
[all …]
/kernel/linux/linux-6.6/scripts/gdb/linux/
Dtasks.py42 def get_task_by_pid(pid): argument
44 if int(task['pid']) == pid:
50 """Find Linux task by PID and return the task_struct variable.
52 $lx_task_by_pid(PID): Given PID, iterate over all tasks of the target and
53 return that task_struct variable which PID matches."""
58 def invoke(self, pid): argument
59 task = get_task_by_pid(pid)
63 raise gdb.GdbError("No task of PID " + str(pid))
76 gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
80 task["pid"].format_string(),
[all …]
/kernel/linux/linux-5.10/arch/um/os-Linux/skas/
Dprocess.c27 int is_skas_winch(int pid, int fd, void *data) in is_skas_winch() argument
29 return pid == getpgrp(); in is_skas_winch()
32 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
37 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
56 void wait_stub_done(int pid) in wait_stub_done() argument
61 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
68 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
80 err = ptrace_dump_regs(pid); in wait_stub_done()
85 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, in wait_stub_done()
92 static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs) in get_skas_faultinfo() argument
[all …]
/kernel/linux/linux-5.10/arch/um/os-Linux/
Dstart_up.c32 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local
38 kill(pid, SIGKILL); in ptrace_child()
40 kill(pid, SIGSTOP); in ptrace_child()
48 if (sc_result == pid) in ptrace_child()
95 int pid, n, status; in start_ptraced_child() local
99 pid = fork(); in start_ptraced_child()
100 if (pid == 0) in start_ptraced_child()
102 else if (pid < 0) in start_ptraced_child()
105 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child()
112 return pid; in start_ptraced_child()
[all …]
/kernel/linux/linux-6.6/drivers/staging/hungtask/
Dhungtask_user.c23 pid_t pid; member
37 static void htuser_show_task(int pid) in htuser_show_task() argument
41 p = pid_task(find_vpid(pid), PIDTYPE_PID); in htuser_show_task()
43 pr_err("can not find pid %d\n", pid); in htuser_show_task()
48 pr_info("process %d is frozen\n", pid); in htuser_show_task()
58 static void htuser_list_insert(int pid, int count) in htuser_list_insert() argument
66 userlist[userlist_count].pid = pid; in htuser_list_insert()
73 static int htuser_list_remove(int pid) in htuser_list_remove() argument
79 if (userlist[i].pid == pid) { in htuser_list_remove()
106 htuser_show_task(userlist[i].pid); in htuser_list_update()
[all …]
/kernel/linux/linux-5.10/drivers/staging/hungtask/
Dhungtask_user.c23 pid_t pid; member
37 static void htuser_show_task(int pid) in htuser_show_task() argument
41 p = pid_task(find_vpid(pid), PIDTYPE_PID); in htuser_show_task()
43 pr_err("can not find pid %d\n", pid); in htuser_show_task()
48 pr_info("process %d is frozen\n", pid); in htuser_show_task()
58 static void htuser_list_insert(int pid, int count) in htuser_list_insert() argument
66 userlist[userlist_count].pid = pid; in htuser_list_insert()
73 static int htuser_list_remove(int pid) in htuser_list_remove() argument
79 if (userlist[i].pid == pid) { in htuser_list_remove()
106 htuser_show_task(userlist[i].pid); in htuser_list_update()
[all …]
/kernel/linux/linux-6.6/arch/um/os-Linux/skas/
Dprocess.c27 int is_skas_winch(int pid, int fd, void *data) in is_skas_winch() argument
29 return pid == getpgrp(); in is_skas_winch()
80 static int ptrace_dump_regs(int pid) in ptrace_dump_regs() argument
85 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in ptrace_dump_regs()
107 void wait_stub_done(int pid) in wait_stub_done() argument
112 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); in wait_stub_done()
119 err = ptrace(PTRACE_CONT, pid, 0, 0); in wait_stub_done()
131 err = ptrace_dump_regs(pid); in wait_stub_done()
135 …printk(UM_KERN_ERR "%s : failed to wait for SIGTRAP, pid = %d, n = %d, errno = %d, status = 0x%x\n… in wait_stub_done()
136 __func__, pid, n, errno, status); in wait_stub_done()
[all …]
/kernel/linux/linux-5.10/scripts/gdb/linux/
Dtasks.py42 def get_task_by_pid(pid): argument
44 if int(task['pid']) == pid:
50 """Find Linux task by PID and return the task_struct variable.
52 $lx_task_by_pid(PID): Given PID, iterate over all tasks of the target and
53 return that task_struct variable which PID matches."""
58 def invoke(self, pid): argument
59 task = get_task_by_pid(pid)
63 raise gdb.GdbError("No task of PID " + str(pid))
76 gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
80 task["pid"].format_string(),
[all …]

12345678910>>...174