Home
last modified time | relevance | path

Searched refs:thread (Results 1 – 25 of 213) sorted by relevance

123456789

/tools/perf/util/
Dthread.h32 DECLARE_RC_STRUCT(thread) { in DECLARE_RC_STRUCT() argument
73 struct thread *thread__new(pid_t pid, pid_t tid);
74 int thread__init_maps(struct thread *thread, struct machine *machine);
75 void thread__delete(struct thread *thread);
79 struct thread *thread__get(struct thread *thread);
80 void thread__put(struct thread *thread);
82 static inline void __thread__zput(struct thread **thread) in __thread__zput() argument
84 thread__put(*thread); in __thread__zput()
85 *thread = NULL; in __thread__zput()
88 #define thread__zput(thread) __thread__zput(&thread) argument
[all …]
Dthread.c22 int thread__init_maps(struct thread *thread, struct machine *machine) in thread__init_maps() argument
24 pid_t pid = thread__pid(thread); in thread__init_maps()
26 if (pid == thread__tid(thread) || pid == -1) { in thread__init_maps()
27 thread__set_maps(thread, maps__new(machine)); in thread__init_maps()
29 struct thread *leader = machine__findnew_thread(machine, pid, pid); in thread__init_maps()
32 thread__set_maps(thread, maps__get(thread__maps(leader))); in thread__init_maps()
37 return thread__maps(thread) ? 0 : -1; in thread__init_maps()
40 struct thread *thread__new(pid_t pid, pid_t tid) in thread__new()
42 RC_STRUCT(thread) *_thread = zalloc(sizeof(*_thread)); in thread__new()
43 struct thread *thread; in thread__new() local
[all …]
Dthread-stack.h14 struct thread;
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,
96 int thread_stack__flush(struct thread *thread);
97 void thread_stack__free(struct thread *thread);
[all …]
Dthreads.h8 struct thread;
17 struct thread *last_match;
27 struct thread *threads__find(struct threads *threads, pid_t tid);
28 struct thread *threads__findnew(struct threads *threads, pid_t pid, pid_t tid, bool *created);
30 void threads__remove(struct threads *threads, struct thread *thread);
32 int (*fn)(struct thread *thread, void *data),
Dthread-stack.c113 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()
173 static struct thread_stack *thread_stack__new(struct thread *thread, int cpu, in thread_stack__new() argument
178 struct thread_stack *ts = thread__ts(thread), *new_ts; in thread_stack__new()
182 if (thread_stack__per_cpu(thread) && cpu > 0) in thread_stack__new()
192 free(thread__ts(thread)); in thread_stack__new()
193 thread__set_ts(thread, new_ts); in thread_stack__new()
[all …]
Ddb-export.c62 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
99 return __db_export__comm(dbe, comm, thread); in db_export__comm()
109 struct thread *main_thread) in db_export__exec_comm()
[all …]
Ddb-export.h15 struct thread;
44 int (*export_thread)(struct db_export *dbe, struct thread *thread,
47 struct thread *thread);
49 struct comm *comm, struct thread *thread);
84 int db_export__thread(struct db_export *dbe, struct thread *thread,
85 struct machine *machine, struct thread *main_thread);
87 struct thread *thread);
89 struct thread *main_thread);
91 struct thread *thread);
Dthreads.c64 static struct thread *__threads_table_entry__get_last_match(struct threads_table_entry *table, in __threads_table_entry__get_last_match()
67 struct thread *th, *res = NULL; in __threads_table_entry__get_last_match()
78 struct thread *th) in __threads_table_entry__set_last_match()
85 struct thread *th) in threads_table_entry__set_last_match()
92 struct thread *threads__find(struct threads *threads, pid_t tid) in threads__find()
95 struct thread *res; in threads__find()
109 struct thread *threads__findnew(struct threads *threads, pid_t pid, pid_t tid, bool *created) in threads__findnew()
112 struct thread *res = NULL; in threads__findnew()
145 struct thread *old_value; in threads__remove_all_threads()
154 void threads__remove(struct threads *threads, struct thread *thread) in threads__remove() argument
[all …]
Dmachine.c65 static void thread__set_guest_comm(struct thread *thread, pid_t pid) in thread__set_guest_comm() argument
70 thread__set_comm(thread, comm, 0); in thread__set_guest_comm()
106 struct thread *thread = machine__findnew_thread(machine, -1, in machine__init() local
109 if (thread == NULL) in machine__init()
112 thread__set_guest_comm(thread, pid); in machine__init()
113 thread__put(thread); in machine__init()
348 static struct thread *findnew_guest_code(struct machine *machine, in findnew_guest_code()
352 struct thread *host_thread; in findnew_guest_code()
353 struct thread *thread; in findnew_guest_code() local
359 thread = machine__findnew_thread(machine, -1, pid); in findnew_guest_code()
[all …]
Dcounts.h20 perf_counts(struct perf_counts *counts, int cpu_map_idx, int thread) in perf_counts() argument
22 return xyarray__entry(counts->values, cpu_map_idx, thread); in perf_counts()
26 perf_counts__is_loaded(struct perf_counts *counts, int cpu_map_idx, int thread) in perf_counts__is_loaded() argument
28 return *((bool *) xyarray__entry(counts->loaded, cpu_map_idx, thread)); in perf_counts__is_loaded()
32 perf_counts__set_loaded(struct perf_counts *counts, int cpu_map_idx, int thread, bool loaded) in perf_counts__set_loaded() argument
34 *((bool *) xyarray__entry(counts->loaded, cpu_map_idx, thread)) = loaded; in perf_counts__set_loaded()
Dprint_insn.h9 struct thread;
15 size_t sample__fprintf_insn_asm(struct perf_sample *sample, struct thread *thread,
18 ssize_t fprintf_insn_asm(struct machine *machine, struct thread *thread, u8 cpumode,
Dunwind.h11 struct thread;
25 struct thread *thread,
36 struct thread *thread,
64 struct thread *thread __maybe_unused, in unwind__get_entries()
Dunwind-libdw.h10 struct thread;
12 bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg);
18 struct thread *thread; member
Dprint_insn.c84 static size_t print_insn_x86(struct thread *thread, u8 cpumode, cs_insn *insn, in print_insn_x86() argument
95 thread__find_symbol(thread, cpumode, op->imm, &al)) { in print_insn_x86()
122 ssize_t fprintf_insn_asm(struct machine *machine, struct thread *thread, u8 cpumode, in fprintf_insn_asm() argument
140 printed = print_insn_x86(thread, cpumode, &insn[0], print_opts, fp); in fprintf_insn_asm()
154 size_t sample__fprintf_insn_asm(struct perf_sample *sample, struct thread *thread, in sample__fprintf_insn_asm() argument
161 printed = fprintf_insn_asm(machine, thread, sample->cpumode, is64bit, in sample__fprintf_insn_asm()
171 struct thread *thread __maybe_unused, in sample__fprintf_insn_asm()
Dmachine.h20 struct thread;
99 struct thread *machine__find_thread(struct machine *machine, pid_t pid,
101 struct thread *machine__idle_thread(struct machine *machine);
103 struct thread *thread);
160 struct thread *machines__findnew_guest_code(struct machines *machines, pid_t pid);
161 struct thread *machine__findnew_guest_code(struct machine *machine, pid_t pid);
172 void machine__remove_thread(struct machine *machine, struct thread *th);
181 int __thread__resolve_callchain(struct thread *thread,
190 static inline int thread__resolve_callchain(struct thread *thread, in thread__resolve_callchain() argument
198 return __thread__resolve_callchain(thread, in thread__resolve_callchain()
[all …]
/tools/perf/tests/
Ddwarf-unwind.c65 int test_dwarf_unwind__thread(struct thread *thread);
67 int test_dwarf_unwind__krava_3(struct thread *thread);
68 int test_dwarf_unwind__krava_2(struct thread *thread);
69 int test_dwarf_unwind__krava_1(struct thread *thread);
112 NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thread) in test_dwarf_unwind__thread() argument
120 if (test__arch_unwind_sample(&sample, thread)) { in test_dwarf_unwind__thread()
125 err = unwind__get_entries(unwind_entry, &cnt, thread, in test_dwarf_unwind__thread()
146 struct thread *thread = *(struct thread **)p1; in test_dwarf_unwind__compare() local
152 global_unwind_retval = test_dwarf_unwind__thread(thread); in test_dwarf_unwind__compare()
155 global_unwind_retval = test_dwarf_unwind__thread(thread); in test_dwarf_unwind__compare()
[all …]
/tools/perf/scripts/python/
Dstat-cpi.py10 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
27 store_key(time, cpu, thread)
28 key = get_key(time, event, cpu, thread)
31 def get(time, event, cpu, thread): argument
32 key = get_key(time, event, cpu, thread)
[all …]
/tools/lib/perf/
Devsel.c57 int idx, thread; in perf_evsel__alloc_fd() local
60 for (thread = 0; thread < nthreads; thread++) { in perf_evsel__alloc_fd()
61 int *fd = FD(evsel, idx, thread); in perf_evsel__alloc_fd()
87 static int get_group_fd(struct perf_evsel *evsel, int cpu_map_idx, int thread, int *group_fd) in get_group_fd() argument
104 fd = FD(leader, cpu_map_idx, thread); in get_group_fd()
117 int idx, thread, err = 0; in perf_evsel__open() local
148 for (thread = 0; thread < threads->nr; thread++) { in perf_evsel__open()
151 evsel_fd = FD(evsel, idx, thread); in perf_evsel__open()
157 err = get_group_fd(evsel, idx, thread, &group_fd); in perf_evsel__open()
162 threads->map[thread].pid, in perf_evsel__open()
[all …]
/tools/perf/trace/beauty/
Dpid.c8 struct thread *thread = machine__findnew_thread(trace->host, pid, pid); in syscall_arg__scnprintf_pid() local
10 if (thread != NULL) { in syscall_arg__scnprintf_pid()
11 if (!thread__comm_set(thread)) in syscall_arg__scnprintf_pid()
12 thread__set_comm_from_proc(thread); in syscall_arg__scnprintf_pid()
14 if (thread__comm_set(thread)) in syscall_arg__scnprintf_pid()
16 " (%s)", thread__comm_str(thread)); in syscall_arg__scnprintf_pid()
17 thread__put(thread); in syscall_arg__scnprintf_pid()
/tools/testing/selftests/powerpc/tm/
Dtm-vmx-unavail.c91 pthread_t *thread; in tm_vmx_unavail_test() local
99 thread = malloc(sizeof(pthread_t)*threads); in tm_vmx_unavail_test()
100 if (!thread) in tm_vmx_unavail_test()
104 pthread_create(&thread[i], NULL, &worker, NULL); in tm_vmx_unavail_test()
107 pthread_join(thread[i], NULL); in tm_vmx_unavail_test()
109 free(thread); in tm_vmx_unavail_test()
Dtm-tmspr.c94 pthread_t *thread; in test_tmspr() local
104 thread = malloc(thread_num * sizeof(pthread_t)); in test_tmspr()
105 if (thread == NULL) in test_tmspr()
110 if (pthread_create(&thread[i], NULL, (void *)tfiar_tfhar, in test_tmspr()
116 if (pthread_create(&thread[i], NULL, (void *)texasr, (void *)i)) in test_tmspr()
121 if (pthread_join(thread[i], NULL) != 0) in test_tmspr()
125 free(thread); in test_tmspr()
/tools/perf/arch/powerpc/tests/
Ddwarf-unwind.c14 struct thread *thread, u64 *regs) in sample_ustack() argument
29 map = maps__find(thread__maps(thread), (u64)sp); in sample_ustack()
46 struct thread *thread) in test__arch_unwind_sample() argument
62 return sample_ustack(sample, thread, buf); in test__arch_unwind_sample()
/tools/perf/arch/arm/tests/
Ddwarf-unwind.c14 struct thread *thread, u64 *regs) in sample_ustack() argument
29 map = maps__find(thread__maps(thread), (u64)sp); in sample_ustack()
46 struct thread *thread) in test__arch_unwind_sample() argument
62 return sample_ustack(sample, thread, buf); in test__arch_unwind_sample()
/tools/perf/arch/arm64/tests/
Ddwarf-unwind.c14 struct thread *thread, u64 *regs) in sample_ustack() argument
29 map = maps__find(thread__maps(thread), (u64)sp); in sample_ustack()
46 struct thread *thread) in test__arch_unwind_sample() argument
62 return sample_ustack(sample, thread, buf); in test__arch_unwind_sample()
/tools/perf/arch/x86/tests/
Ddwarf-unwind.c14 struct thread *thread, u64 *regs) in sample_ustack() argument
29 map = maps__find(thread__maps(thread), (u64)sp); in sample_ustack()
54 struct thread *thread) in test__arch_unwind_sample() argument
78 return sample_ustack(sample, thread, buf); in test__arch_unwind_sample()

123456789