| /linux/include/linux/ |
| H A D | pid.h | 17 * What is struct pid? 19 * A struct pid is the kernel's internal notion of a process identifier. 21 * there are processes attached to it the struct pid lives in a hash 23 * quickly from the numeric pid value. The attached processes may be 24 * quickly accessed by following pointers from struct pid. 27 * problem. The process originally with that pid may have exited and the 28 * pid allocator wrapped, and another process could have come along 29 * and been assigned that pid. 36 * a struct pid is about 64 bytes. 38 * Holding a reference to struct pid solves both of these problems. [all …]
|
| H A D | pidfs.h | 6 #include <linux/pid.h> 10 struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags); 12 void pidfs_prepare_pid(struct pid *pid); 13 int pidfs_add_pid(struct pid *pid); 14 void pidfs_remove_pid(struct pid *pid); 20 int pidfs_register_pid_gfp(struct pid *pid, gfp_t gfp); 23 * pidfs_register_pid - register a struct pid in pidfs 24 * @pid: pid to pin 26 * Register a struct pid in pidfs. 30 static inline int pidfs_register_pid(struct pid *pid) in pidfs_register_pid() argument [all …]
|
| /linux/kernel/ |
| H A D | pid.c | 3 * 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: 49 struct pid init_struct_pid = { 67 * PID-map pages start out as NULL, they get allocated upon 88 void put_pid(struct pid *pid) in put_pid() argument 92 if (!pid) in put_pid() 95 ns = pid->numbers[pid->level].ns; in put_pid() 96 if (refcount_dec_and_test(&pid->count)) { in put_pid() [all …]
|
| /linux/fs/ |
| H A D | pidfs.c | 10 #include <linux/pid.h> 68 .key_offset = offsetof(struct pid, ino), 70 .head_offset = offsetof(struct pid, pidfs_hash), 78 * to struct pid is the inode number. 80 * On 32 bit the 64 bit number assigned to struct pid is split 167 void pidfs_prepare_pid(struct pid *pid) in pidfs_prepare_pid() argument 169 pid->stashed = NULL; in pidfs_prepare_pid() 170 pid->attr = NULL; in pidfs_prepare_pid() 171 pid in pidfs_prepare_pid() 174 pidfs_add_pid(struct pid * pid) pidfs_add_pid() argument 186 pidfs_remove_pid(struct pid * pid) pidfs_remove_pid() argument 209 pidfs_free_pid(struct pid * pid) pidfs_free_pid() argument 274 struct pid *pid = pidfd_pid(f); pidfd_show_fdinfo() local 308 struct pid *pid = pidfd_pid(file); pidfd_poll() local 329 pid_in_current_pidns(const struct pid * pid) pid_in_current_pidns() argument 369 struct pid *pid = pidfd_pid(file); pidfd_info() local 695 struct pid *pid = inode->i_private; pidfs_file_release() local 751 struct pid *pid = task_pid(tsk); pidfs_exit() local 796 pidfs_coredump_pid(struct pid * pid,const struct coredump_params * cprm) pidfs_coredump_pid() argument 849 struct pid *pid = inode->i_private; pidfs_listxattr() local 862 struct pid *pid = inode->i_private; pidfs_evict_inode() local 891 const struct pid *pid = inode->i_private; pidfs_encode_fh() local 906 struct pid *pid; pidfs_ino_get_pid() local 931 struct pid *pid; pidfs_fh_to_dentry() local 1015 const struct pid *pid = data; pidfs_init_inode() local 1031 struct pid *pid = data; pidfs_put_data() local 1045 pidfs_register_pid_gfp(struct pid * pid,gfp_t gfp) pidfs_register_pid_gfp() argument 1100 struct pid *pid = d_inode(dentry)->i_private; pidfs_stash_dentry() local 1121 struct pid *pid = inode->i_private; pidfs_xattr_get() local 1132 struct pid *pid = inode->i_private; pidfs_xattr_set() local 1181 pidfs_alloc_file(struct pid * pid,unsigned int flags) pidfs_alloc_file() argument [all...] |
| /linux/tools/testing/selftests/rlimits/ |
| H A D | rlimits-per-userns.c | 32 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 …]
|
| /linux/tools/testing/selftests/powerpc/ptrace/ |
| H A D | ptrace-perf-hwbreak.c | 39 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 …]
|
| /linux/include/trace/events/ |
| H A D | oom.h | 19 __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 pgtables=%lukB oom_score_adj=%hd", 106 __entry->pid, [all...] |
| /linux/tools/testing/selftests/clone3/ |
| H A D | clone3_set_tid.c | 6 * PID namespace. 45 pid_t pid = -1; in call_clone3_set_tid() local 54 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid() 55 if (pid < 0) { in call_clone3_set_tid() 61 if (pid == 0) { in call_clone3_set_tid() 66 ksft_print_msg("I am the child, my PID is %d (expected %d)\n", in call_clone3_set_tid() 96 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid() 97 ksft_print_msg("I am the parent (%d). My child's pid is %d\n", in call_clone3_set_tid() 98 getpid(), pid); in call_clone3_set_tid() 101 "Expected child pid %d does not match actual pid %d\n", in call_clone3_set_tid() [all …]
|
| H A D | clone3_cap_checkpoint_restore.c | 6 * PID namespace. 41 pid_t pid = -1; in call_clone3_set_tid() local 49 pid = sys_clone3(&args, sizeof(args)); in call_clone3_set_tid() 50 if (pid < 0) { in call_clone3_set_tid() 55 if (pid == 0) { in call_clone3_set_tid() 56 TH_LOG("I am the child, my PID is %d (expected %d)", getpid(), set_tid[0]); in call_clone3_set_tid() 63 TH_LOG("I am the parent (%d). My child's pid is %d", getpid(), pid); in call_clone3_set_tid() 65 if (waitpid(pid, &status, 0) < 0) { in call_clone3_set_tid() 123 pid_t pid; in set_capability() 136 pid_t pid; TEST() local [all...] |
| /linux/tools/testing/selftests/powerpc/signal/ |
| H A D | sigreturn_kernel.c | 35 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 …]
|
| /linux/tools/testing/selftests/pid_namespace/ |
| H A D | pid_max.c | 105 pid_t pid; in pid_max_nested_inner() 134 pid = fork(); in pid_max_nested_inner() 135 if (pid == 0) in pid_max_nested_inner() 137 wait_for_pid(pid); in pid_max_nested_inner() 138 if (pid > inner_limit) { in pid_max_nested_inner() local 139 fprintf(stderr, "Managed to create pid number beyond limit\n"); in pid_max_nested_inner() 196 fprintf(stderr, "Managed to create process even though ancestor pid namespace had a limit\n"); in pid_max_nested_outer() 202 pid_t pid; in pid_max_nested_outer() 204 pid = fork(); in pid_max_nested_outer() 205 if (pid < in pid_max_nested_outer() 41 pid_t pid; pid_max_cb() local 162 pid_t pid; pid_max_nested_outer() local 230 pid_t pid; pid_max_nested_limit_inner() local 288 pid_t pid; pid_max_nested_limit_outer() local 333 pid_t pid; TEST() local 343 pid_t pid; TEST() local 352 pid_t pid; TEST() local [all...] |
| /linux/kernel/trace/ |
| H A D | pid_list.c | 90 static inline int pid_split(unsigned int pid, unsigned int *upper1, in pid_split() argument 96 /* In case a bad pid is passed in, then fail */ in pid_split() 97 if (unlikely(pid >= MAX_PID)) in pid_split() 100 *upper1 = (pid >> UPPER1_SHIFT) & UPPER_MASK; in pid_split() 101 *upper2 = (pid >> UPPER2_SHIFT) & UPPER_MASK; in pid_split() 102 *lower = pid & LOWER_MASK; in pid_split() 116 * trace_pid_list_is_set - test if the pid is set in the list 117 * @pid_list: The pid list to test 118 * @pid: The pid to see if set in the list. 120 * Tests if @pid is set in the @pid_list. This is usually called [all …]
|
| /linux/tools/testing/selftests/riscv/vector/ |
| H A D | validate_v_ptrace.c | 23 pid_t pid; in TEST() local 29 pid = (pid_t)syscall(SYS_clone, SIGCHLD, 0, NULL, 0, NULL); in TEST() 30 ASSERT_LE(0, pid) in TEST() 33 if (pid == 0) { in TEST() 48 ASSERT_EQ(0, ptrace(PTRACE_ATTACH, pid, NULL, NULL)); in TEST() 49 ASSERT_EQ(pid, waitpid(pid, &status, 0)); in TEST() 54 ASSERT_EQ(0, ptrace(PTRACE_POKEDATA, pid, &chld_lock, 0)); in TEST() 58 ASSERT_EQ(0, ptrace(PTRACE_CONT, pid, NULL, NULL)); in TEST() 59 ASSERT_EQ(pid, waitpid(pid, &status, 0)); in TEST() 73 ret = ptrace(PTRACE_GETREGSET, pid, NT_RISCV_VECTOR, &iov); in TEST() [all …]
|
| /linux/scripts/gdb/linux/ |
| H A D | tasks.py | 38 def get_task_by_pid(pid): argument 40 if int(task['pid']) == pid: 46 """Find Linux task by PID and return the task_struct variable. 48 $lx_task_by_pid(PID): Given PID, iterate over all tasks of the target and 49 return that task_struct variable which PID matches.""" 54 def invoke(self, pid): argument 55 task = get_task_by_pid(pid) 59 raise gdb.GdbError("No task of PID " 119 invoke(self, pid) global() argument [all...] |
| /linux/drivers/media/common/b2c2/ |
| H A D | flexcop-hw-filter.c | 4 * flexcop-hw-filter.c - pid and mac address filtering and control functions 47 u16 pid, u16 mask) in flexcop_pid_group_filter() argument 51 v30c.pid_filter_30c_ext_ind_0_7.Group_PID = pid; in flexcop_pid_group_filter() 61 /* this fancy define reduces the code size of the quite similar PID controlling of 68 vpid.vregname.field = onoff ? pid : 0x1fff; \ 75 u16 pid, int onoff) in flexcop_pid_Stream1_PID_ctrl() argument 82 u16 pid, int onoff) in flexcop_pid_Stream2_PID_ctrl() argument 89 u16 pid, int onoff) in flexcop_pid_PCR_PID_ctrl() argument 95 u16 pid, int onoff) in flexcop_pid_PMT_PID_ctrl() argument 101 u16 pid, int onoff) in flexcop_pid_EMM_PID_ctrl() argument [all …]
|
| /linux/tools/testing/selftests/ftrace/test.d/trigger/inter-event/ |
| H A D | trigger-inter-event-combined-hist.tc | 13 echo 'waking_latency u64 lat pid_t pid' > synthetic_events 20 echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger 21 echo 'hist:keys=pid:waking_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).waking_laten… 22 echo 'hist:keys=pid,lat:sort=pid,lat' > events/synthetic/waking_latency/trigger 24 echo 'wakeup_latency u64 lat pid_t pid' >> synthetic_events 25 echo 'hist:keys=pid:ts1=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger 28 echo 'waking_plus_wakeup_latency u64 lat; pid_t pid' >> synthetic_events 29 …ho 'hist:keys=pid,lat:sort=pid,lat:ww_lat=$waking_lat+$wakeup_lat:onmatch(synthetic.wakeup_latency… 30 echo 'hist:keys=pid,lat:sort=pid,lat' >> events/synthetic/waking_plus_wakeup_latency/trigger 33 if ! grep -q "pid:" events/synthetic/waking_plus_wakeup_latency/hist; then
|
| /linux/tools/perf/scripts/perl/ |
| H A D | rw-by-pid.pl | |
| /linux/include/uapi/linux/dvb/ |
| H A D | dmx.h | 60 * @DMX_PES_AUDIO0: first audio PID. Also referred as @DMX_PES_AUDIO. 61 * @DMX_PES_VIDEO0: first video PID. Also referred as @DMX_PES_VIDEO. 62 * @DMX_PES_TELETEXT0: first teletext PID. Also referred as @DMX_PES_TELETEXT. 63 * @DMX_PES_SUBTITLE0: first subtitle PID. Also referred as @DMX_PES_SUBTITLE. 64 * @DMX_PES_PCR0: first Program Clock Reference PID. 67 * @DMX_PES_AUDIO1: second audio PID. 68 * @DMX_PES_VIDEO1: second video PID. 69 * @DMX_PES_TELETEXT1: second teletext PID. 70 * @DMX_PES_SUBTITLE1: second subtitle PID. 71 * @DMX_PES_PCR1: second Program Clock Reference PID. [all …]
|
| /linux/tools/perf/scripts/python/ |
| H A D | netdev-times.py | |
| /linux/tools/testing/selftests/core/ |
| H A D | close_range_test.c | 118 pid_t pid; in TEST() local 137 pid = sys_clone3(&args, sizeof(args)); in TEST() 138 ASSERT_GE(pid, 0); in TEST() 140 if (pid == 0) { in TEST() 199 EXPECT_EQ(waitpid(pid, &status, 0), pid); in TEST() 207 pid_t pid; in TEST() local 226 pid = sys_clone3(&args, sizeof(args)); in TEST() 227 ASSERT_GE(pid, 0); in TEST() 229 if (pid == 0) { in TEST() 242 EXPECT_EQ(waitpid(pid, &status, 0), pid); in TEST() [all …]
|
| /linux/tools/testing/selftests/pidfd/ |
| H A D | pidfd_test.c | 148 pid_t pid; in test_pidfd_send_signal_exited_fail() local 158 pid = fork(); in test_pidfd_send_signal_exited_fail() 159 if (pid < 0) in test_pidfd_send_signal_exited_fail() 163 if (pid == 0) in test_pidfd_send_signal_exited_fail() 166 snprintf(buf, sizeof(buf), "/proc/%d", pid); in test_pidfd_send_signal_exited_fail() 170 ret = wait_for_pid(pid); in test_pidfd_send_signal_exited_fail() 208 const char *test_name = "pidfd_send_signal signal recycled pid"; in test_pidfd_send_signal_recycled_pid_fail() 220 ksft_test_result_skip("%s test: Unsharing pid namespace not permitted\n", in test_pidfd_send_signal_recycled_pid_fail() 224 ksft_exit_fail_msg("%s test: Failed to unshare pid namespace\n", in test_pidfd_send_signal_recycled_pid_fail() 244 /* pid 1 in new pid namespace */ in test_pidfd_send_signal_recycled_pid_fail() [all …]
|
| /linux/arch/um/os-Linux/ |
| H A D | start_up.c | 44 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local 50 kill(pid, SIGKILL); in ptrace_child() 52 kill(pid, SIGSTOP); in ptrace_child() 60 if (sc_result == pid) in ptrace_child() 107 int pid, n, status; in start_ptraced_child() local 111 pid = fork(); in start_ptraced_child() 112 if (pid == 0) in start_ptraced_child() 114 else if (pid < 0) in start_ptraced_child() 117 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child() 124 return pid; in start_ptraced_child() [all …]
|
| /linux/arch/powerpc/platforms/powernv/ |
| H A D | vas-trace.h | 24 __field(int, pid) 34 __entry->pid = tsk->pid; 42 TP_printk("pid=%d, vasid=%d, cop=%d, lpid=%d, pid=%d, tid=%d", 43 __entry->pid, __entry->vasid, __entry->cop, 59 __field(int, pid) 68 __entry->pid = tsk->pid; 75 TP_printk("pid=%d, vasid=%d, cop=%d, lpid=%d, pidr=%d", 76 __entry->pid, __entry->vasid, __entry->cop, 90 __field(int, pid) 97 __entry->pid = tsk->pid; [all …]
|
| /linux/tools/testing/selftests/cgroup/ |
| H A D | cgroup_util.c | |
| /linux/tools/perf/util/ |
| H A D | thread_map.c | 34 struct perf_thread_map *thread_map__new_by_pid(pid_t pid) in thread_map__new_by_pid() argument 42 sprintf(name, "/proc/%d/task", pid); in thread_map__new_by_pid() 96 pid_t pid = strtol(dirent->d_name, &end, 10); in thread_map__new_all_cpus() local 101 snprintf(path, sizeof(path), "/proc/%d/task", pid); in thread_map__new_all_cpus() 104 pr_debug("scandir for %d returned empty, skipping\n", pid); in thread_map__new_all_cpus() 151 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid) in thread_map__new() argument 153 if (pid != -1) in thread_map__new() 154 return thread_map__new_by_pid(pid); in thread_map__new() 166 pid_t pid, prev_pid = INT_MAX; in thread_map__new_by_pid_str() local 174 pid in thread_map__new_by_pid_str() 264 thread_map__new_str(const char * pid,const char * tid,bool all_threads) thread_map__new_str() argument 286 get_comm(char ** comm,pid_t pid) get_comm() argument 312 pid_t pid = perf_thread_map__pid(map, i); comm_init() local 365 thread_map__has(struct perf_thread_map * threads,pid_t pid) thread_map__has() argument [all...] |