| /linux/include/linux/ |
| H A D | pid.h | 57 struct pid { struct 77 extern struct pid init_struct_pid; argument 81 struct pid *pidfd_pid(const struct file *file); 82 struct pid *pidfd_get_pid(unsigned int fd, unsigned int *flags); 84 int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret_file); 87 static inline struct pid *get_pid(struct pid *pid) in get_pid() argument 89 if (pid) in get_pid() 90 refcount_inc(&pid->count); in get_pid() 91 return pid; in get_pid() 94 extern void put_pid(struct pid *pid); [all …]
|
| H A D | pidfs.h | 7 struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags); 9 void pidfs_add_pid(struct pid *pid); 10 void pidfs_remove_pid(struct pid *pid); 16 int pidfs_register_pid(struct pid *pid); 17 void pidfs_free_pid(struct pid *pid);
|
| /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/kernel/ |
| H A D | pid.c | 50 struct pid init_struct_pid = { 95 void put_pid(struct pid *pid) in put_pid() argument 99 if (!pid) in put_pid() 102 ns = pid->numbers[pid->level].ns; in put_pid() 103 if (refcount_dec_and_test(&pid->count)) { in put_pid() 104 pidfs_free_pid(pid); in put_pid() 105 kmem_cache_free(ns->pid_cachep, pid); in put_pid() 113 struct pid *pid = container_of(rhp, struct pid, rcu); in delayed_put_pid() local 114 put_pid(pid); in delayed_put_pid() 117 void free_pid(struct pid *pid) in free_pid() argument [all …]
|
| /linux/fs/ |
| H A D | pidfs.c | 89 struct pid *pid_a = rb_entry(a, struct pid, pidfs_node); in pidfs_ino_cmp() 90 struct pid *pid_b = rb_entry(b, struct pid, pidfs_node); in pidfs_ino_cmp() 101 void pidfs_add_pid(struct pid *pid) in pidfs_add_pid() argument 133 pid->ino = pidfs_ino_nr; in pidfs_add_pid() 134 pid->stashed = NULL; in pidfs_add_pid() 135 pid->attr = NULL; in pidfs_add_pid() 139 rb_find_add_rcu(&pid->pidfs_node, &pidfs_ino_tree, pidfs_ino_cmp); in pidfs_add_pid() 143 void pidfs_remove_pid(struct pid *pid) in pidfs_remove_pid() argument 146 rb_erase(&pid->pidfs_node, &pidfs_ino_tree); in pidfs_remove_pid() 150 void pidfs_free_pid(struct pid *pid) in pidfs_free_pid() argument [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/arch/powerpc/mm/book3s64/ |
| H A D | radix_tlb.c | 29 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 …]
|
| /linux/tools/testing/selftests/pid_namespace/ |
| H A D | pid_max.c | 41 pid_t pid; in pid_max_cb() local 70 pid = fork(); in pid_max_cb() 71 if (pid == 0) in pid_max_cb() 73 wait_for_pid(pid); in pid_max_cb() 74 if (pid > 500) { in pid_max_cb() 138 pid_t pid; in pid_max_nested_inner() local 140 pid = fork(); in pid_max_nested_inner() 141 if (pid < 0) in pid_max_nested_inner() 144 if (pid == 0) in pid_max_nested_inner() 147 wait_for_pid(pid); in pid_max_nested_inner() [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/include/trace/events/ |
| H A D | oom.h | 19 __field( pid_t, pid) 25 __entry->pid = task->pid; 31 __entry->pid, __entry->comm, __entry->oom_score_adj) 82 __field(int, pid) 94 __entry->pid = task->pid; 106 __entry->pid, 119 TP_PROTO(int pid), 121 TP_ARGS(pid), 124 __field(int, pid) 128 __entry->pid = pid; [all …]
|
| H A D | sched.h | 24 __field( pid_t, pid ) 29 __entry->pid = t->pid; 32 TP_printk("comm=%s pid=%d", __get_str(comm), __entry->pid) 149 __field( pid_t, pid ) 156 __entry->pid = p->pid; 162 __entry->comm, __entry->pid, __entry->prio, 241 __entry->prev_pid = prev->pid; 245 __entry->next_pid = next->pid; 280 __field( pid_t, pid ) 288 __entry->pid = p->pid; [all …]
|
| /linux/tools/testing/selftests/namespaces/ |
| H A D | nsid_test.c | 53 pid_t pid; in TEST() local 66 pid = fork(); in TEST() 67 ASSERT_GE(pid, 0); in TEST() 69 if (pid == 0) { in TEST() 102 kill(pid, SIGTERM); in TEST() 103 waitpid(pid, NULL, 0); in TEST() 112 snprintf(path, sizeof(path), "/proc/%d/ns/mnt", pid); in TEST() 128 kill(pid, SIGTERM); in TEST() 129 waitpid(pid, NULL, 0); in TEST() 162 pid_t pid; in TEST() local [all …]
|
| /linux/arch/um/os-Linux/ |
| H A D | start_up.c | 43 int pid = os_getpid(), ppid = getppid(); in ptrace_child() local 49 kill(pid, SIGKILL); in ptrace_child() 51 kill(pid, SIGSTOP); in ptrace_child() 59 if (sc_result == pid) in ptrace_child() 106 int pid, n, status; in start_ptraced_child() local 110 pid = fork(); in start_ptraced_child() 111 if (pid == 0) in start_ptraced_child() 113 else if (pid < 0) in start_ptraced_child() 116 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); in start_ptraced_child() 123 return pid; in start_ptraced_child() [all …]
|
| /linux/arch/powerpc/mm/nohash/ |
| H A D | tlb.c | 130 unsigned int pid; in local_flush_tlb_mm() local 133 pid = mm->context.id; in local_flush_tlb_mm() 134 if (pid != MMU_NO_CONTEXT) in local_flush_tlb_mm() 135 _tlbil_pid(pid); in local_flush_tlb_mm() 143 unsigned int pid; in __local_flush_tlb_page() local 146 pid = mm ? mm->context.id : 0; in __local_flush_tlb_page() 147 if (pid != MMU_NO_CONTEXT) in __local_flush_tlb_page() 148 _tlbil_va(vmaddr, pid, tsize, ind); in __local_flush_tlb_page() 177 unsigned int pid; member 186 _tlbil_pid(p ? p->pid : 0); in do_flush_tlb_mm_ipi() [all …]
|
| /linux/tools/perf/scripts/perl/ |
| H A D | rw-by-pid.pl | 82 foreach my $pid (sort { ($reads{$b}{bytes_read} || 0) <=> 84 my $comm = $reads{$pid}{comm} || ""; 85 my $total_reads = $reads{$pid}{total_reads} || 0; 86 my $bytes_requested = $reads{$pid}{bytes_requested} || 0; 87 my $bytes_read = $reads{$pid}{bytes_read} || 0; 89 printf("%6s %-20s %10s %10s %10s\n", $pid, $comm, 101 foreach my $pid (keys %reads) { 102 foreach my $error (keys %{$reads{$pid}{errors}}) { 103 my $comm = $reads{$pid}{comm} || ""; 104 my $errcount = $reads{$pid}{errors}{$error} || 0; [all …]
|
| /linux/drivers/gpu/drm/amd/amdkfd/ |
| H A D | kfd_smi_events.c | 43 pid_t pid; member 163 static bool kfd_smi_ev_enabled(pid_t pid, struct kfd_smi_client *client, in kfd_smi_ev_enabled() argument 168 if (pid && client->pid != pid && !client->suser) in kfd_smi_ev_enabled() 174 static void add_event_to_kfifo(pid_t pid, struct kfd_node *dev, in add_event_to_kfifo() argument 182 if (!kfd_smi_ev_enabled(pid, client, smi_event)) in add_event_to_kfifo() 199 static void kfd_smi_event_add(pid_t pid, struct kfd_node *dev, in kfd_smi_event_add() argument 215 add_event_to_kfifo(pid, dev, event, fifo_in, len); in kfd_smi_event_add() 256 if (task_info->task.pid) in kfd_smi_event_update_vmfault() 258 task_info->task.pid, task_info->task.comm)); in kfd_smi_event_update_vmfault() 263 void kfd_smi_event_page_fault_start(struct kfd_node *node, pid_t pid, in kfd_smi_event_page_fault_start() argument [all …]
|
| /linux/tools/testing/selftests/cgroup/lib/ |
| H A D | cgroup_util.c | 316 int pid = strtol(ptr, &ptr, 10); in cg_killall() local 318 if (pid == 0) in cg_killall() 324 if (kill(pid, SIGKILL)) in cg_killall() 351 int cg_enter(const char *cgroup, int pid) in cg_enter() argument 355 snprintf(pidbuf, sizeof(pidbuf), "%d", pid); in cg_enter() 373 int pid, retcode; in cg_run() local 375 pid = fork(); in cg_run() 376 if (pid < 0) { in cg_run() 377 return pid; in cg_run() 378 } else if (pid == 0) { in cg_run() [all …]
|
| /linux/arch/powerpc/mm/ |
| H A D | mmu_decl.h | 31 static inline void _tlbil_pid(unsigned int pid) in _tlbil_pid() argument 34 trace_tlbia(pid); in _tlbil_pid() 36 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) argument 40 extern void _tlbil_pid(unsigned int pid); 42 extern void _tlbil_pid_noind(unsigned int pid); 44 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) argument 52 static inline void _tlbil_va(unsigned long address, unsigned int pid, in _tlbil_va() argument 56 trace_tlbie(0, 0, address, pid, 0, 0, 0); in _tlbil_va() 59 extern void _tlbil_va(unsigned long address, unsigned int pid, 62 extern void __tlbil_va(unsigned long address, unsigned int pid); [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | task_kfunc_common.h | 25 struct task_struct *bpf_task_from_pid(s32 pid) __ksym; 32 s32 pid; in tasks_kfunc_map_value_lookup() local 35 status = bpf_probe_read_kernel(&pid, sizeof(pid), &p->pid); in tasks_kfunc_map_value_lookup() 39 return bpf_map_lookup_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_value_lookup() 47 s32 pid; in tasks_kfunc_map_insert() local 49 status = bpf_probe_read_kernel(&pid, sizeof(pid), &p->pid); in tasks_kfunc_map_insert() 54 status = bpf_map_update_elem(&__tasks_kfunc_map, &pid, &local, BPF_NOEXIST); in tasks_kfunc_map_insert() 58 v = bpf_map_lookup_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_insert() 60 bpf_map_delete_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_insert()
|
| H A D | test_uprobe.c | 18 pid_t pid = bpf_get_current_pid_tgid() >> 32; in BPF_UPROBE() local 20 if (pid != my_pid) in BPF_UPROBE() 30 pid_t pid = bpf_get_current_pid_tgid() >> 32; in BPF_UPROBE() local 32 if (pid != my_pid) in BPF_UPROBE() 42 pid_t pid = bpf_get_current_pid_tgid() >> 32; in BPF_URETPROBE() local 44 if (pid != my_pid) in BPF_URETPROBE() 54 pid_t pid = bpf_get_current_pid_tgid() >> 32; in BPF_UPROBE() local 56 if (pid != my_pid) in BPF_UPROBE() 69 pid_t pid = bpf_get_current_pid_tgid() >> 32; in BPF_UPROBE() local 71 if (pid != my_pid) in BPF_UPROBE() [all …]
|
| /linux/tools/testing/selftests/ptrace/ |
| H A D | get_syscall_info.c | 17 kill_tracee(pid_t pid) in kill_tracee() argument 19 if (!pid) in kill_tracee() 24 int rc = kill(pid, SIGKILL); in kill_tracee() 31 sys_ptrace(int request, pid_t pid, unsigned long addr, unsigned long data) in sys_ptrace() argument 33 return syscall(__NR_ptrace, request, pid, addr, data); in sys_ptrace() 38 kill_tracee(pid); \ 77 pid_t pid = fork(); in TEST() local 79 ASSERT_LE(0, pid) { in TEST() 83 if (pid == 0) { in TEST() 85 pid = getpid(); in TEST() [all …]
|
| /linux/Documentation/translations/zh_CN/accounting/ |
| H A D | taskstats.rst | 23 “pid”、“tid”、“任务”互换使用,用于描述由struct task_struct定义的标准 24 Linux任务。“每pid的统计数据”等价于“每任务的统计数据”。 35 (NETLINK_GENERIC族)然后发送指定pid或tgid的命令。响应消息中包含单个 36 任务的统计信息(若指定了pid)或进程所有任务汇总的统计信息(若指定了tgid)。 39 cpu掩码内的cpu上有任务退出时,每pid的统计信息将发送给注册成功的监听者。使用 44 记录也将发送给用户空间。后者包含线程组中所有线程(包括过去和现在)的每pid统计 59 struct taskstats是每pid和每tgid数据共用的计数结构体。它是版本化的,可在内核新增 71 1. 命令:由用户发送给内核。获取指定pid/tgid数据的命令包含一个类型为 72 TASKSTATS_CMD_ATTR_PID/TGID的属性,该属性包含u32的pid或tgid载荷。 73 pid/tgid指示用户空间要统计的任务/进程。 [all …]
|
| /linux/scripts/ |
| H A D | bootgraph.pl | 86 my $pid = $2; 88 if (!defined($pidctr{$pid})) { 89 $func = "wait_" . $pid . "_1"; 90 $pidctr{$pid} = 1; 92 $pidctr{$pid} = $pidctr{$pid} + 1; 93 $func = "wait_" . $pid . "_" . $pidctr{$pid}; 102 $pids{$func} = $pid; 114 my $pid = $2; 115 my $func = "wait_" . $pid . "_" . $pidctr{$pid}; 178 my $pid = $pids{$key}; [all …]
|
| /linux/drivers/media/common/b2c2/ |
| H A D | flexcop-hw-filter.c | 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() 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 107 u16 pid, int onoff) in flexcop_pid_ECM_PID_ctrl() argument 113 int index, u16 pid, int onoff) in flexcop_pid_control() argument [all …]
|
| /linux/tools/testing/selftests/clone3/ |
| H A D | clone3_set_tid.c | 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() 96 if (expected_pid == 0 || expected_pid == pid) { in call_clone3_set_tid() 98 getpid(), pid); in call_clone3_set_tid() 102 expected_pid, pid); in call_clone3_set_tid() 106 if (waitpid(pid, &status, 0) < 0) { in call_clone3_set_tid() 151 pid_t pid, ns1, ns2, ns3, ns_pid; in main() local 270 pid = fork(); in main() [all …]
|