/linux/tools/perf/util/ |
H A D | thread.h | 32 DECLARE_RC_STRUCT(thread) { in DECLARE_RC_STRUCT() argument 33 /** @maps: mmaps associated with this thread. */ in DECLARE_RC_STRUCT() 36 /** @tid: thread ID number unique to a machine. */ in DECLARE_RC_STRUCT() 38 /** @ppid: parent process of the process this thread belongs to. */ in DECLARE_RC_STRUCT() 41 int guest_cpu; /* For QEMU thread */ in DECLARE_RC_STRUCT() 44 * @exited: Has the thread had an exit event. Such threads are usually in DECLARE_RC_STRUCT() 64 * @e_machine: The ELF EM_* associated with the thread. EM_NONE if not in DECLARE_RC_STRUCT() 77 struct thread *thread__new(pid_t pid, pid_t tid); 78 int thread__init_maps(struct thread *thread, struct machine *machine); 79 void thread__delete(struct thread *thread); [all …]
|
H A D | thread.c | 12 #include "thread.h" 13 #include "thread-stack.h" 25 int thread__init_maps(struct thread *thread, struct machine *machine) in thread__init_maps() argument 27 pid_t pid = thread__pid(thread); in thread__init_maps() 29 if (pid == thread__tid(thread) || pid == -1) { in thread__init_maps() 30 thread__set_maps(thread, maps__new(machine)); in thread__init_maps() 32 struct thread *leader = machine__findnew_thread(machine, pid, pid); in thread__init_maps() 35 thread__set_maps(thread, maps__get(thread__maps(leader))); in thread__init_maps() 40 return thread__maps(thread) ? 0 : -1; in thread__init_maps() 43 struct thread *thread__new(pid_t pid, pid_t tid) in thread__new() [all …]
|
H A D | thread-stack.h | 3 * thread-stack.h: Synthesize a thread's stack using call / return events 14 struct thread; 39 * @thread: thread in which call/return occurred 54 struct thread *thread; member 82 int thread_stack__event(struct thread *thread, int cpu, u32 flags, u64 from_ip, 85 void thread_stack__set_trace_nr(struct thread *thread, int cpu, u64 trace_nr); 86 void thread_stack__sample(struct thread *thread, int cpu, struct ip_callchain *chain, 88 void thread_stack__sample_late(struct thread *thread, int cpu, 91 void thread_stack__br_sample(struct thread *thread, int cpu, 93 void thread_stack__br_sample_late(struct thread *thread, int cpu, [all …]
|
H A D | db-export.c | 13 #include "thread.h" 18 #include "thread-stack.h" 62 int db_export__thread(struct db_export *dbe, struct thread *thread, in db_export__thread() argument 63 struct machine *machine, struct thread *main_thread) in db_export__thread() 67 if (thread__db_id(thread)) in db_export__thread() 70 thread__set_db_id(thread, ++dbe->thread_last_db_id); in db_export__thread() 76 return dbe->export_thread(dbe, thread, main_thread_db_id, in db_export__thread() 83 struct thread *thread) in __db_export__comm() argument 88 return dbe->export_comm(dbe, comm, thread); in __db_export__comm() 94 struct thread *thread) in db_export__comm() argument [all …]
|
H A D | thread-stack.c | 3 * thread-stack.c: Synthesize a thread's stack using call / return events 14 #include "thread.h" 22 #include "thread-stack.h" 40 * struct thread_stack_entry - thread stack entry. 68 * struct thread_stack - thread stack constructed from 'call' and 'return' 113 static inline bool thread_stack__per_cpu(struct thread *thread) in thread_stack__per_cpu() argument 115 return !(thread__tid(thread) || thread__pid(thread)); in thread_stack__per_cpu() 136 static int thread_stack__init(struct thread_stack *ts, struct thread *thread, in thread_stack__init() argument 158 if (thread__maps(thread) && maps__machine(thread__maps(thread))) { in thread_stack__init() 159 struct machine *machine = maps__machine(thread__maps(thread)); in thread_stack__init() [all …]
|
/linux/arch/mips/include/asm/ |
H A D | asmmacro-32.h | 16 .macro fpu_save_single thread tmp=t0 20 s.d $f0, THREAD_FPR0(\thread) 21 s.d $f2, THREAD_FPR2(\thread) 22 s.d $f4, THREAD_FPR4(\thread) 23 s.d $f6, THREAD_FPR6(\thread) 24 s.d $f8, THREAD_FPR8(\thread) 25 s.d $f10, THREAD_FPR10(\thread) 26 s.d $f12, THREAD_FPR12(\thread) 27 s.d $f14, THREAD_FPR14(\thread) 28 s.d $f16, THREAD_FPR16(\thread) [all …]
|
H A D | asmmacro.h | 84 .macro fpu_save_16even thread tmp=t0 88 sdc1 $f0, THREAD_FPR0(\thread) 89 sdc1 $f2, THREAD_FPR2(\thread) 90 sdc1 $f4, THREAD_FPR4(\thread) 91 sdc1 $f6, THREAD_FPR6(\thread) 92 sdc1 $f8, THREAD_FPR8(\thread) 93 sdc1 $f10, THREAD_FPR10(\thread) 94 sdc1 $f12, THREAD_FPR12(\thread) 95 sdc1 $f14, THREAD_FPR14(\thread) 96 sdc1 $f16, THREAD_FPR16(\thread) [all …]
|
H A D | asmmacro-64.h | 17 .macro cpu_save_nonscratch thread 18 LONG_S s0, THREAD_REG16(\thread) 19 LONG_S s1, THREAD_REG17(\thread) 20 LONG_S s2, THREAD_REG18(\thread) 21 LONG_S s3, THREAD_REG19(\thread) 22 LONG_S s4, THREAD_REG20(\thread) 23 LONG_S s5, THREAD_REG21(\thread) 24 LONG_S s6, THREAD_REG22(\thread) 25 LONG_S s7, THREAD_REG23(\thread) 26 LONG_S sp, THREAD_REG29(\thread) [all …]
|
/linux/arch/riscv/kernel/ |
H A D | asm-offsets.c | 24 OFFSET(TASK_THREAD_RA, task_struct, thread.ra); in asm_offsets() 25 OFFSET(TASK_THREAD_SP, task_struct, thread.sp); in asm_offsets() 26 OFFSET(TASK_THREAD_S0, task_struct, thread.s[0]); in asm_offsets() 27 OFFSET(TASK_THREAD_S1, task_struct, thread.s[1]); in asm_offsets() 28 OFFSET(TASK_THREAD_S2, task_struct, thread.s[2]); in asm_offsets() 29 OFFSET(TASK_THREAD_S3, task_struct, thread.s[3]); in asm_offsets() 30 OFFSET(TASK_THREAD_S4, task_struct, thread.s[4]); in asm_offsets() 31 OFFSET(TASK_THREAD_S5, task_struct, thread.s[5]); in asm_offsets() 32 OFFSET(TASK_THREAD_S6, task_struct, thread.s[6]); in asm_offsets() 33 OFFSET(TASK_THREAD_S7, task_struct, thread.s[7]); in asm_offsets() [all …]
|
/linux/Documentation/translations/zh_CN/mm/ |
H A D | mmu_notifier.rst | 43 CPU-thread-0 {尝试写到addrA} 44 CPU-thread-1 {尝试写到addrB} 45 CPU-thread-2 {} 46 CPU-thread-3 {} 47 DEV-thread-0 {读取addrA并填充设备TLB} 48 DEV-thread-2 {读取addrB并填充设备TLB} 50 CPU-thread-0 {COW_step0: {mmu_notifier_invalidate_range_start(addrA)}} 51 CPU-thread-1 {COW_step0: {mmu_notifier_invalidate_range_start(addrB)}} 52 CPU-thread-2 {} 53 CPU-thread-3 {} [all …]
|
/linux/arch/powerpc/kernel/ptrace/ |
H A D | ptrace-adv.c | 10 struct pt_regs *regs = task->thread.regs; in user_enable_single_step() 13 task->thread.debug.dbcr0 &= ~DBCR0_BT; in user_enable_single_step() 14 task->thread.debug.dbcr0 |= DBCR0_IDM | DBCR0_IC; in user_enable_single_step() 22 struct pt_regs *regs = task->thread.regs; in user_enable_block_step() 25 task->thread.debug.dbcr0 &= ~DBCR0_IC; in user_enable_block_step() 26 task->thread.debug.dbcr0 = DBCR0_IDM | DBCR0_BT; in user_enable_block_step() 34 struct pt_regs *regs = task->thread.regs; in user_disable_single_step() 43 task->thread.debug.dbcr0 &= ~(DBCR0_IC | DBCR0_BT); in user_disable_single_step() 47 if (!DBCR_ACTIVE_EVENTS(task->thread.debug.dbcr0, in user_disable_single_step() 48 task->thread.debug.dbcr1)) { in user_disable_single_step() [all …]
|
H A D | ptrace-noadv.c | 12 struct pt_regs *regs = task->thread.regs; in user_enable_single_step() 21 struct pt_regs *regs = task->thread.regs; in user_enable_block_step() 30 struct pt_regs *regs = task->thread.regs; in user_disable_single_step() 68 dabr_fake = ((child->thread.hw_brk[0].address & (~HW_BRK_TYPE_DABR)) | in ptrace_get_debugreg() 69 (child->thread.hw_brk[0].type & HW_BRK_TYPE_DABR)); in ptrace_get_debugreg() 82 struct thread_struct *thread = &task->thread; in ptrace_set_debugreg() local 121 bp = thread->ptrace_bps[0]; in ptrace_set_debugreg() 125 thread->ptrace_bps[0] = NULL; in ptrace_set_debugreg() 142 thread->ptrace_bps[0] = bp; in ptrace_set_debugreg() 143 thread->hw_brk[0] = hw_brk; in ptrace_set_debugreg() [all …]
|
/linux/tools/perf/scripts/python/ |
H A D | stat-cpi.py | 10 def get_key(time, event, cpu, thread): argument 11 return "%d-%s-%d-%d" % (time, event, cpu, thread) 13 def store_key(time, cpu, thread): argument 20 if (thread not in threads): 21 threads.append(thread) 23 def store(time, event, cpu, thread, val, ena, run): argument 24 #print("event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % 25 # (event, cpu, thread, time, val, ena, run)) 27 store_key(time, cpu, thread) 28 key = get_key(time, event, cpu, thread) [all …]
|
/linux/drivers/md/dm-vdo/ |
H A D | thread-utils.c | 6 #include "thread-utils.h" 21 struct thread { struct 37 struct thread *thread = arg; in thread_starter() local 39 thread->thread_task = current; in thread_starter() 41 hlist_add_head(&thread->thread_links, &thread_list); in thread_starter() 44 thread->thread_function(thread->thread_data); in thread_starter() 46 complete(&thread->thread_done); in thread_starter() 51 const char *name, struct thread **new_thread) in vdo_create_thread() 56 struct thread *thread; in vdo_create_thread() local 59 result = vdo_allocate(1, struct thread, __func__, &thread); in vdo_create_thread() [all …]
|
H A D | thread-registry.c | 6 #include "thread-registry.h" 14 * We need to be careful when using other facilities that may use thread registry functions in 24 /* Register the current thread and associate it with a data pointer. */ 28 struct registered_thread *thread; in vdo_register_thread() local 36 list_for_each_entry(thread, ®istry->links, links) { in vdo_register_thread() 37 if (thread->task == current) { in vdo_register_thread() 39 list_del_rcu(&thread->links); in vdo_register_thread() 47 VDO_ASSERT_LOG_ONLY(!found_it, "new thread not already in registry"); in vdo_register_thread() 51 INIT_LIST_HEAD(&thread->links); in vdo_register_thread() 57 struct registered_thread *thread; in vdo_unregister_thread() local [all …]
|
/linux/Documentation/mm/ |
H A D | mmu_notifier.rst | 39 CPU-thread-0 {try to write to addrA} 40 CPU-thread-1 {try to write to addrB} 41 CPU-thread-2 {} 42 CPU-thread-3 {} 43 DEV-thread-0 {read addrA and populate device TLB} 44 DEV-thread-2 {read addrB and populate device TLB} 46 CPU-thread-0 {COW_step0: {mmu_notifier_invalidate_range_start(addrA)}} 47 CPU-thread-1 {COW_step0: {mmu_notifier_invalidate_range_start(addrB)}} 48 CPU-thread-2 {} 49 CPU-thread-3 {} [all …]
|
/linux/tools/perf/tests/ |
H A D | dwarf-unwind.c | 17 #include "thread.h" 47 int test_dwarf_unwind__thread(struct thread *thread); 49 int test_dwarf_unwind__krava_3(struct thread *thread); 50 int test_dwarf_unwind__krava_2(struct thread *thread); 51 int test_dwarf_unwind__krava_1(struct thread *thread); 94 NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thread) in test_dwarf_unwind__thread() argument 101 if (test__arch_unwind_sample(&sample, thread)) { in test_dwarf_unwind__thread() 106 err = unwind__get_entries(unwind_entry, &cnt, thread, in test_dwarf_unwind__thread() 127 /* Any possible value should be 'thread' */ in test_dwarf_unwind__compare() 128 struct thread *thread = *(struct thread **)p1; in test_dwarf_unwind__compare() local [all …]
|
/linux/arch/parisc/kernel/ |
H A D | asm-offsets.c | 50 DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs)); in main() 51 DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0])); in main() 52 DEFINE(TASK_PT_GR1, offsetof(struct task_struct, thread.regs.gr[ 1])); in main() 53 DEFINE(TASK_PT_GR2, offsetof(struct task_struct, thread.regs.gr[ 2])); in main() 54 DEFINE(TASK_PT_GR3, offsetof(struct task_struct, thread.regs.gr[ 3])); in main() 55 DEFINE(TASK_PT_GR4, offsetof(struct task_struct, thread.regs.gr[ 4])); in main() 56 DEFINE(TASK_PT_GR5, offsetof(struct task_struct, thread.regs.gr[ 5])); in main() 57 DEFINE(TASK_PT_GR6, offsetof(struct task_struct, thread.regs.gr[ 6])); in main() 58 DEFINE(TASK_PT_GR7, offsetof(struct task_struct, thread.regs.gr[ 7])); in main() 59 DEFINE(TASK_PT_GR8, offsetof(struct task_struct, thread.regs.gr[ 8])); in main() [all …]
|
/linux/tools/perf/pmu-events/arch/arm64/arm/cortex-a65-e1/ |
H A D | ifu.json | 57 "PublicDescription": "Thread flushed due to TLB miss", 60 "BriefDescription": "Thread flushed due to TLB miss" 63 "PublicDescription": "Thread flushed due to reasons other than TLB miss", 66 "BriefDescription": "Thread flushed due to reasons other than TLB miss" 69 "PublicDescription": "This thread and the other thread both ready for scheduling in if0", 72 "BriefDescription": "This thread and the other thread both ready for scheduling in if0" 75 …"PublicDescription": "This thread was arbitrated when the other thread was also ready for scheduli… 78 …"BriefDescription": "This thread was arbitrated when the other thread was also ready for schedulin… 81 …"PublicDescription": "This thread was arbitrated when the other thread was also active, but not ne… 84 …"BriefDescription": "This thread was arbitrated when the other thread was also active, but not nec… [all …]
|
/linux/arch/powerpc/kernel/ |
H A D | process.c | 86 * If we are saving the current thread's registers, and the in check_if_tm_restore_required() 87 * thread is in a transactional state, set the TIF_RESTORE_TM in check_if_tm_restore_required() 91 if (tsk == current && tsk->thread.regs && in check_if_tm_restore_required() 92 MSR_TM_ACTIVE(tsk->thread.regs->msr) && in check_if_tm_restore_required() 94 regs_set_return_msr(&tsk->thread.ckpt_regs, in check_if_tm_restore_required() 95 tsk->thread.regs->msr); in check_if_tm_restore_required() 156 msr = tsk->thread.regs->msr; in __giveup_fpu() 160 regs_set_return_msr(tsk->thread.regs, msr); in __giveup_fpu() 179 if (tsk->thread.regs) { in flush_fp_to_thread() 189 if (tsk->thread.regs->msr & MSR_FP) { in flush_fp_to_thread() [all …]
|
/linux/arch/loongarch/include/asm/ |
H A D | asmmacro.h | 13 .macro cpu_save_nonscratch thread 14 stptr.d s0, \thread, THREAD_REG23 15 stptr.d s1, \thread, THREAD_REG24 16 stptr.d s2, \thread, THREAD_REG25 17 stptr.d s3, \thread, THREAD_REG26 18 stptr.d s4, \thread, THREAD_REG27 19 stptr.d s5, \thread, THREAD_REG28 20 stptr.d s6, \thread, THREAD_REG29 21 stptr.d s7, \thread, THREAD_REG30 22 stptr.d s8, \thread, THREAD_REG31 [all …]
|
/linux/arch/s390/kernel/ |
H A D | process.c | 59 /* Kernel thread */ in __ret_from_fork() 91 dst->thread.kfpu_flags = 0; in arch_dup_task_struct() 98 * refers to the source thread. in arch_dup_task_struct() 100 dst->thread.ri_cb = NULL; in arch_dup_task_struct() 101 dst->thread.gs_cb = NULL; in arch_dup_task_struct() 102 dst->thread.gs_bc_cb = NULL; in arch_dup_task_struct() 119 p->thread.ksp = (unsigned long) frame; in copy_thread() 120 /* Save access registers to new thread structure. */ in copy_thread() 121 save_access_regs(&p->thread.acrs[0]); in copy_thread() 124 memset(&p->thread.per_user, 0, sizeof(p->thread.per_user)); in copy_thread() [all …]
|
/linux/arch/um/kernel/ |
H A D | process.c | 73 to->thread.prev_sched = from; in __switch_to() 76 switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); in __switch_to() 79 return current->thread.prev_sched; in __switch_to() 84 struct pt_regs *regs = ¤t->thread.regs; in interrupt_end() 113 if (current->thread.prev_sched != NULL) in new_thread_handler() 114 schedule_tail(current->thread.prev_sched); in new_thread_handler() 115 current->thread.prev_sched = NULL; in new_thread_handler() 117 fn = current->thread.request.thread.proc; in new_thread_handler() 118 arg = current->thread.request.thread.arg; in new_thread_handler() 121 * callback returns only if the kernel thread execs a process in new_thread_handler() [all …]
|
/linux/arch/mips/kernel/ |
H A D | asm-offsets.c | 124 OFFSET(THREAD_REG16, task_struct, thread.reg16); in output_thread_defines() 125 OFFSET(THREAD_REG17, task_struct, thread.reg17); in output_thread_defines() 126 OFFSET(THREAD_REG18, task_struct, thread.reg18); in output_thread_defines() 127 OFFSET(THREAD_REG19, task_struct, thread.reg19); in output_thread_defines() 128 OFFSET(THREAD_REG20, task_struct, thread.reg20); in output_thread_defines() 129 OFFSET(THREAD_REG21, task_struct, thread.reg21); in output_thread_defines() 130 OFFSET(THREAD_REG22, task_struct, thread.reg22); in output_thread_defines() 131 OFFSET(THREAD_REG23, task_struct, thread.reg23); in output_thread_defines() 132 OFFSET(THREAD_REG29, task_struct, thread.reg29); in output_thread_defines() 133 OFFSET(THREAD_REG30, task_struct, thread.reg30); in output_thread_defines() [all …]
|
/linux/tools/lib/perf/ |
H A D | evsel.c | 70 int idx, thread; in perf_evsel__alloc_fd() local 73 for (thread = 0; thread < nthreads; thread++) { in perf_evsel__alloc_fd() 74 int *fd = FD(evsel, idx, thread); in perf_evsel__alloc_fd() 100 static int get_group_fd(struct perf_evsel *evsel, int cpu_map_idx, int thread, int *group_fd) in get_group_fd() argument 117 fd = FD(leader, cpu_map_idx, thread); in get_group_fd() 130 int idx, thread, err = 0; in perf_evsel__open() local 161 for (thread = 0; thread < threads->nr; thread++) { in perf_evsel__open() 164 evsel_fd = FD(evsel, idx, thread); in perf_evsel__open() 170 err = get_group_fd(evsel, idx, thread, &group_fd); in perf_evsel__open() 175 threads->map[thread].pid, in perf_evsel__open() [all …]
|