Lines Matching refs:ttrace
1180 struct thread_trace *ttrace = zalloc(sizeof(struct thread_trace)); in thread_trace__new() local
1182 if (ttrace) in thread_trace__new()
1183 ttrace->paths.max = -1; in thread_trace__new()
1185 ttrace->syscall_stats = intlist__new(NULL); in thread_trace__new()
1187 return ttrace; in thread_trace__new()
1192 struct thread_trace *ttrace; in thread__trace() local
1203 ttrace = thread__priv(thread); in thread__trace()
1204 ++ttrace->nr_events; in thread__trace()
1206 return ttrace; in thread__trace()
1263 struct thread_trace *ttrace = thread__priv(thread); in trace__set_fd_pathname() local
1265 if (fd > ttrace->paths.max) { in trace__set_fd_pathname()
1266 char **npath = realloc(ttrace->paths.table, (fd + 1) * sizeof(char *)); in trace__set_fd_pathname()
1271 if (ttrace->paths.max != -1) { in trace__set_fd_pathname()
1272 memset(npath + ttrace->paths.max + 1, 0, in trace__set_fd_pathname()
1273 (fd - ttrace->paths.max) * sizeof(char *)); in trace__set_fd_pathname()
1278 ttrace->paths.table = npath; in trace__set_fd_pathname()
1279 ttrace->paths.max = fd; in trace__set_fd_pathname()
1282 ttrace->paths.table[fd] = strdup(pathname); in trace__set_fd_pathname()
1284 return ttrace->paths.table[fd] != NULL ? 0 : -1; in trace__set_fd_pathname()
1316 struct thread_trace *ttrace = thread__priv(thread); in thread__fd_path() local
1318 if (ttrace == NULL) in thread__fd_path()
1324 if ((fd > ttrace->paths.max || ttrace->paths.table[fd] == NULL)) { in thread__fd_path()
1332 return ttrace->paths.table[fd]; in thread__fd_path()
1353 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__scnprintf_close_fd() local
1355 if (ttrace && fd >= 0 && fd <= ttrace->paths.max) in syscall_arg__scnprintf_close_fd()
1356 zfree(&ttrace->paths.table[fd]); in syscall_arg__scnprintf_close_fd()
1658 static void thread__update_stats(struct thread_trace *ttrace, in thread__update_stats() argument
1665 inode = intlist__findnew(ttrace->syscall_stats, id); in thread__update_stats()
1678 if (ttrace->entry_time && sample->time > ttrace->entry_time) in thread__update_stats()
1679 duration = sample->time - ttrace->entry_time; in thread__update_stats()
1686 struct thread_trace *ttrace; in trace__printf_interrupted_entry() local
1693 ttrace = thread__priv(trace->current); in trace__printf_interrupted_entry()
1695 if (!ttrace->entry_pending) in trace__printf_interrupted_entry()
1698 duration = sample->time - ttrace->entry_time; in trace__printf_interrupted_entry()
1701 printed += fprintf(trace->output, "%-70s) ...\n", ttrace->entry_str); in trace__printf_interrupted_entry()
1702 ttrace->entry_pending = false; in trace__printf_interrupted_entry()
1717 struct thread_trace *ttrace; in trace__sys_enter() local
1726 ttrace = thread__trace(thread, trace->output); in trace__sys_enter()
1727 if (ttrace == NULL) in trace__sys_enter()
1732 if (ttrace->entry_str == NULL) { in trace__sys_enter()
1733 ttrace->entry_str = malloc(1024); in trace__sys_enter()
1734 if (!ttrace->entry_str) in trace__sys_enter()
1741 ttrace->entry_time = sample->time; in trace__sys_enter()
1742 msg = ttrace->entry_str; in trace__sys_enter()
1751 fprintf(trace->output, "%-70s\n", ttrace->entry_str); in trace__sys_enter()
1754 ttrace->entry_pending = true; in trace__sys_enter()
1773 struct thread_trace *ttrace; in trace__sys_exit() local
1782 ttrace = thread__trace(thread, trace->output); in trace__sys_exit()
1783 if (ttrace == NULL) in trace__sys_exit()
1787 thread__update_stats(ttrace, id, sample); in trace__sys_exit()
1797 ttrace->exit_time = sample->time; in trace__sys_exit()
1799 if (ttrace->entry_time) { in trace__sys_exit()
1800 duration = sample->time - ttrace->entry_time; in trace__sys_exit()
1811 if (ttrace->entry_pending) { in trace__sys_exit()
1812 fprintf(trace->output, "%-70s", ttrace->entry_str); in trace__sys_exit()
1837 ttrace->entry_pending = false; in trace__sys_exit()
1859 struct thread_trace *ttrace = thread__trace(thread, trace->output); in trace__sched_stat_runtime() local
1861 if (ttrace == NULL) in trace__sched_stat_runtime()
1864 ttrace->runtime_ms += runtime_ms; in trace__sched_stat_runtime()
1926 struct thread_trace *ttrace; in trace__pgfault() local
1929 ttrace = thread__trace(thread, trace->output); in trace__pgfault()
1930 if (ttrace == NULL) in trace__pgfault()
1934 ttrace->pfmaj++; in trace__pgfault()
1936 ttrace->pfmin++; in trace__pgfault()
2452 static size_t thread__dump_stats(struct thread_trace *ttrace, in thread__dump_stats() argument
2458 struct int_node *inode = intlist__first(ttrace->syscall_stats); in thread__dump_stats()
2510 struct thread_trace *ttrace = thread__priv(thread); in trace__fprintf_one_thread() local
2513 if (ttrace == NULL) in trace__fprintf_one_thread()
2516 ratio = (double)ttrace->nr_events / trace->nr_events * 100.0; in trace__fprintf_one_thread()
2519 printed += fprintf(fp, "%lu events, ", ttrace->nr_events); in trace__fprintf_one_thread()
2521 if (ttrace->pfmaj) in trace__fprintf_one_thread()
2522 printed += fprintf(fp, ", %lu majfaults", ttrace->pfmaj); in trace__fprintf_one_thread()
2523 if (ttrace->pfmin) in trace__fprintf_one_thread()
2524 printed += fprintf(fp, ", %lu minfaults", ttrace->pfmin); in trace__fprintf_one_thread()
2525 printed += fprintf(fp, ", %.3f msec\n", ttrace->runtime_ms); in trace__fprintf_one_thread()
2526 printed += thread__dump_stats(ttrace, trace, fp); in trace__fprintf_one_thread()