Lines Matching defs:thread

44 #include "util/thread.h"
142 struct thread *current;
1289 static struct thread_trace *thread__trace(struct thread *thread, FILE *fp)
1293 if (thread == NULL)
1296 if (thread__priv(thread) == NULL)
1297 thread__set_priv(thread, thread_trace__new());
1299 if (thread__priv(thread) == NULL)
1302 ttrace = thread__priv(thread);
1316 struct thread_trace *ttrace = thread__priv(arg->thread);
1351 struct file *thread__files_entry(struct thread *thread, int fd)
1353 return thread_trace__files_entry(thread__priv(thread), fd);
1356 static int trace__set_fd_pathname(struct thread *thread, int fd, const char *pathname)
1358 struct thread_trace *ttrace = thread__priv(thread);
1373 static int thread__read_fd_path(struct thread *thread, int fd)
1379 if (thread->pid_ == thread->tid) {
1381 "/proc/%d/fd/%d", thread->pid_, fd);
1384 "/proc/%d/task/%d/fd/%d", thread->pid_, thread->tid, fd);
1396 return trace__set_fd_pathname(thread, fd, pathname);
1399 static const char *thread__fd_path(struct thread *thread, int fd,
1402 struct thread_trace *ttrace = thread__priv(thread);
1414 if (thread__read_fd_path(thread, fd))
1425 const char *path = thread__fd_path(arg->thread, fd, arg->trace);
1436 struct thread *thread = machine__find_thread(trace->host, pid, pid);
1438 if (thread) {
1439 const char *path = thread__fd_path(thread, fd, trace);
1444 thread__put(thread);
1455 struct thread_trace *ttrace = thread__priv(arg->thread);
1463 static void thread__set_filename_pos(struct thread *thread, const char *bf,
1466 struct thread_trace *ttrace = thread__priv(thread);
1499 thread__set_filename_pos(arg->thread, bf, ptr);
1517 * using ttrace->entry_time for a thread that receives a sys_exit without
1538 static size_t trace__fprintf_comm_tid(struct trace *trace, struct thread *thread, FILE *fp)
1544 printed += fprintf(fp, "%.14s/", thread__comm_str(thread));
1545 printed += fprintf(fp, "%d ", thread->tid);
1551 static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread,
1560 return printed + trace__fprintf_comm_tid(trace, thread, fp);
1989 struct trace *trace, struct thread *thread)
2003 .thread = thread,
2006 struct thread_trace *ttrace = thread__priv(thread);
2149 static void thread__update_stats(struct thread *thread, struct thread_trace *ttrace,
2191 pr_debug("Not enough memory for errno stats for thread \"%s\"(%d/%d), results will be incomplete\n",
2192 thread__comm_str(thread), thread->pid_, thread->tid);
2233 struct perf_sample *sample, struct thread *thread)
2242 thread__comm_str(thread),
2282 struct thread *thread;
2292 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2293 ttrace = thread__trace(thread, trace->output);
2297 trace__fprintf_sample(trace, evsel, sample, thread);
2326 args, augmented_args, augmented_args_size, trace, thread);
2332 trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output);
2344 if (trace->current != thread) {
2346 trace->current = thread__get(thread);
2350 thread__put(thread);
2358 struct thread *thread;
2368 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2369 ttrace = thread__trace(thread, trace->output);
2379 syscall__scnprintf_args(sc, msg, sizeof(msg), args, augmented_args, augmented_args_size, trace, thread);
2383 thread__put(thread);
2400 err = thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack);
2430 struct thread *thread;
2439 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2440 ttrace = thread__trace(thread, trace->output);
2444 trace__fprintf_sample(trace, evsel, sample, thread);
2449 thread__update_stats(thread, ttrace, id, sample, ret, trace->errno_summary);
2452 trace__set_fd_pathname(thread, ret, ttrace->filename.name);
2477 trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace->output);
2516 .thread = thread,
2525 struct thread *child = machine__find_thread(trace->host, ret, ret);
2553 thread__put(thread);
2561 struct thread *thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2568 if (!thread)
2571 ttrace = thread__priv(thread);
2613 thread__put(thread);
2624 struct thread *thread = machine__findnew_thread(trace->host,
2627 struct thread_trace *ttrace = thread__trace(thread, trace->output);
2635 thread__put(thread);
2681 struct thread *thread, void *augmented_args, int augmented_args_size)
2698 .thread = thread,
2758 struct thread *thread;
2769 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2786 if (thread)
2787 trace__fprintf_comm_tid(trace, thread, trace->output);
2802 * the thread should never happen, but if it does...
2819 trace__fprintf_tp_fields(trace, evsel, sample, thread, NULL, 0);
2839 thread__put(thread);
2865 struct thread *thread;
2872 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2883 ttrace = thread__trace(thread, trace->output);
2895 thread__find_symbol(thread, sample->cpumode, sample->ip, &al);
2897 trace__fprintf_entry_head(trace, thread, 0, true, sample->time, trace->output);
2907 thread__find_symbol(thread, sample->cpumode, sample->addr, &al);
2910 thread__find_symbol(thread, sample->cpumode, sample->addr, &al);
2931 thread__put(thread);
2959 struct thread *thread;
2964 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2965 if (thread && thread__is_filtered(thread))
2975 thread__put(thread);
3659 struct thread *thread = machine__find_thread(trace->host, pids[0], pids[0]);
3661 while (thread && nr < ARRAY_SIZE(pids)) {
3662 struct thread *parent = machine__find_thread(trace->host, thread->ppid, thread->ppid);
3672 thread = parent;
4363 static size_t trace__fprintf_thread(FILE *fp, struct thread *thread, struct trace *trace)
4366 struct thread_trace *ttrace = thread__priv(thread);
4374 printed += fprintf(fp, " %s (%d), ", thread__comm_str(thread), thread->tid);
4396 DEFINE_RESORT_RB(threads, (thread__nr_events(a->thread->priv) < thread__nr_events(b->thread->priv)),
4397 struct thread *thread;
4400 entry->thread = rb_entry(nd, struct thread, rb_node);
4418 printed += trace__fprintf_thread(fp, threads_entry->thread, trace);
4759 "show the thread COMM next to its id"),
4768 "trace events on existing thread id"),
4825 "per thread proc mmap processing timeout in ms"),