Lines Matching defs:thread
49 #include "util/thread.h"
145 struct thread *current;
1313 static struct thread_trace *thread__trace(struct thread *thread, FILE *fp)
1317 if (thread == NULL)
1320 if (thread__priv(thread) == NULL)
1321 thread__set_priv(thread, thread_trace__new());
1323 if (thread__priv(thread) == NULL)
1326 ttrace = thread__priv(thread);
1340 struct thread_trace *ttrace = thread__priv(arg->thread);
1386 struct file *thread__files_entry(struct thread *thread, int fd)
1388 return thread_trace__files_entry(thread__priv(thread), fd);
1391 static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
1393 struct thread_trace *ttrace = thread__priv(thread);
1408 static int thread__read_fd_path(struct thread *thread, int fd)
1414 if (thread__pid(thread) == thread__tid(thread)) {
1416 "/proc/%d/fd/%d", thread__pid(thread), fd);
1420 thread__pid(thread), thread__tid(thread), fd);
1432 return trace__set_fd_pathname(thread, fd, pathname);
1435 static const char *thread__fd_path(struct thread *thread, int fd,
1438 struct thread_trace *ttrace = thread__priv(thread);
1450 if (thread__read_fd_path(thread, fd))
1461 const char *path = thread__fd_path(arg->thread, fd, arg->trace);
1472 struct thread *thread = machine__find_thread(trace->host, pid, pid);
1474 if (thread) {
1475 const char *path = thread__fd_path(thread, fd, trace);
1480 thread__put(thread);
1491 struct thread_trace *ttrace = thread__priv(arg->thread);
1499 static void thread__set_filename_pos(struct thread *thread, const char *bf,
1502 struct thread_trace *ttrace = thread__priv(thread);
1535 thread__set_filename_pos(arg->thread, bf, ptr);
1553 * using ttrace->entry_time for a thread that receives a sys_exit without
1581 static size_t trace__fprintf_comm_tid(struct trace *trace, struct thread *thread, FILE *fp)
1587 printed += fprintf(fp, "%.14s/", thread__comm_str(thread));
1588 printed += fprintf(fp, "%d ", thread__tid(thread));
1594 static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread,
1603 return printed + trace__fprintf_comm_tid(trace, thread, fp);
2036 struct trace *trace, struct thread *thread)
2050 .thread = thread,
2053 struct thread_trace *ttrace = thread__priv(thread);
2196 static void thread__update_stats(struct thread *thread, struct thread_trace *ttrace,
2235 pr_debug("Not enough memory for errno stats for thread \"%s\"(%d/%d), results will be incomplete\n",
2236 thread__comm_str(thread), thread__pid(thread),
2237 thread__tid(thread));
2278 struct perf_sample *sample, struct thread *thread)
2287 thread__comm_str(thread),
2335 struct thread *thread;
2345 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2346 ttrace = thread__trace(thread, trace->output);
2350 trace__fprintf_sample(trace, evsel, sample, thread);
2379 args, augmented_args, augmented_args_size, trace, thread);
2385 trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output);
2397 if (trace->current != thread) {
2399 trace->current = thread__get(thread);
2403 thread__put(thread);
2411 struct thread *thread;
2421 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2422 ttrace = thread__trace(thread, trace->output);
2432 syscall__scnprintf_args(sc, msg, sizeof(msg), args, augmented_args, augmented_args_size, trace, thread);
2436 thread__put(thread);
2454 err = thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack);
2485 struct thread *thread;
2494 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2495 ttrace = thread__trace(thread, trace->output);
2499 trace__fprintf_sample(trace, evsel, sample, thread);
2504 thread__update_stats(thread, ttrace, id, sample, ret, trace->errno_summary);
2507 trace__set_fd_pathname(thread, ret, ttrace->filename.name);
2534 trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace->output);
2573 .thread = thread,
2582 struct thread *child = machine__find_thread(trace->host, ret, ret);
2610 thread__put(thread);
2618 struct thread *thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2625 if (!thread)
2628 ttrace = thread__priv(thread);
2670 thread__put(thread);
2681 struct thread *thread = machine__findnew_thread(trace->host,
2684 struct thread_trace *ttrace = thread__trace(thread, trace->output);
2692 thread__put(thread);
2738 struct thread *thread, void *augmented_args, int augmented_args_size)
2755 .thread = thread,
2813 struct thread *thread;
2824 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2843 if (thread)
2844 trace__fprintf_comm_tid(trace, thread, trace->output);
2859 * the thread should never happen, but if it does...
2876 trace__fprintf_tp_fields(trace, evsel, sample, thread, NULL, 0);
2896 thread__put(thread);
2922 struct thread *thread;
2930 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2943 ttrace = thread__trace(thread, trace->output);
2955 thread__find_symbol(thread, sample->cpumode, sample->ip, &al);
2957 trace__fprintf_entry_head(trace, thread, 0, true, sample->time, trace->output);
2967 thread__find_symbol(thread, sample->cpumode, sample->addr, &al);
2970 thread__find_symbol(thread, sample->cpumode, sample->addr, &al);
2991 thread__put(thread);
3020 struct thread *thread;
3025 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
3026 if (thread && thread__is_filtered(thread))
3036 thread__put(thread);
3579 struct thread *thread = machine__find_thread(trace->host, pids[0], pids[0]);
3581 while (thread && nr < ARRAY_SIZE(pids)) {
3582 struct thread *parent = machine__find_thread(trace->host,
3583 thread__ppid(thread),
3584 thread__ppid(thread));
3594 thread = parent;
4284 static size_t trace__fprintf_thread(FILE *fp, struct thread *thread, struct trace *trace)
4287 struct thread_trace *ttrace = thread__priv(thread);
4295 printed += fprintf(fp, " %s (%d), ", thread__comm_str(thread), thread__tid(thread));
4318 (thread__nr_events(thread__priv(a->thread)) <
4319 thread__nr_events(thread__priv(b->thread))),
4320 struct thread *thread;
4323 entry->thread = rb_entry(nd, struct thread_rb_node, rb_node)->thread;
4341 printed += trace__fprintf_thread(fp, threads_entry->thread, trace);
4714 "show the thread COMM next to its id"),
4723 "trace events on existing thread id"),
4776 "per thread proc mmap processing timeout in ms"),