Lines Matching refs:ttrace

1362 	struct thread_trace *ttrace =  zalloc(sizeof(struct thread_trace));  in thread_trace__new()  local
1364 if (ttrace) in thread_trace__new()
1365 ttrace->paths.max = -1; in thread_trace__new()
1367 ttrace->syscall_stats = intlist__new(NULL); in thread_trace__new()
1369 return ttrace; in thread_trace__new()
1374 struct thread_trace *ttrace; in thread__trace() local
1385 ttrace = thread__priv(thread); in thread__trace()
1386 ++ttrace->nr_events; in thread__trace()
1388 return ttrace; in thread__trace()
1455 struct thread_trace *ttrace = thread__priv(thread); in trace__set_fd_pathname() local
1457 if (fd > ttrace->paths.max) { in trace__set_fd_pathname()
1458 char **npath = realloc(ttrace->paths.table, (fd + 1) * sizeof(char *)); in trace__set_fd_pathname()
1463 if (ttrace->paths.max != -1) { in trace__set_fd_pathname()
1464 memset(npath + ttrace->paths.max + 1, 0, in trace__set_fd_pathname()
1465 (fd - ttrace->paths.max) * sizeof(char *)); in trace__set_fd_pathname()
1470 ttrace->paths.table = npath; in trace__set_fd_pathname()
1471 ttrace->paths.max = fd; in trace__set_fd_pathname()
1474 ttrace->paths.table[fd] = strdup(pathname); in trace__set_fd_pathname()
1476 return ttrace->paths.table[fd] != NULL ? 0 : -1; in trace__set_fd_pathname()
1508 struct thread_trace *ttrace = thread__priv(thread); in thread__fd_path() local
1510 if (ttrace == NULL) in thread__fd_path()
1516 if ((fd > ttrace->paths.max || ttrace->paths.table[fd] == NULL)) { in thread__fd_path()
1524 return ttrace->paths.table[fd]; in thread__fd_path()
1545 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__scnprintf_close_fd() local
1547 if (ttrace && fd >= 0 && fd <= ttrace->paths.max) in syscall_arg__scnprintf_close_fd()
1548 zfree(&ttrace->paths.table[fd]); in syscall_arg__scnprintf_close_fd()
1556 struct thread_trace *ttrace = thread__priv(thread); in thread__set_filename_pos() local
1558 ttrace->filename.ptr = ptr; in thread__set_filename_pos()
1559 ttrace->filename.entry_str_pos = bf - ttrace->entry_str; in thread__set_filename_pos()
1908 static void thread__update_stats(struct thread_trace *ttrace, in thread__update_stats() argument
1915 inode = intlist__findnew(ttrace->syscall_stats, id); in thread__update_stats()
1928 if (ttrace->entry_time && sample->time > ttrace->entry_time) in thread__update_stats()
1929 duration = sample->time - ttrace->entry_time; in thread__update_stats()
1936 struct thread_trace *ttrace; in trace__printf_interrupted_entry() local
1943 ttrace = thread__priv(trace->current); in trace__printf_interrupted_entry()
1945 if (!ttrace->entry_pending) in trace__printf_interrupted_entry()
1948 duration = sample->time - ttrace->entry_time; in trace__printf_interrupted_entry()
1951 printed += fprintf(trace->output, "%-70s) ...\n", ttrace->entry_str); in trace__printf_interrupted_entry()
1952 ttrace->entry_pending = false; in trace__printf_interrupted_entry()
1967 struct thread_trace *ttrace; in trace__sys_enter() local
1973 ttrace = thread__trace(thread, trace->output); in trace__sys_enter()
1974 if (ttrace == NULL) in trace__sys_enter()
1979 if (ttrace->entry_str == NULL) { in trace__sys_enter()
1980 ttrace->entry_str = malloc(trace__entry_str_size); in trace__sys_enter()
1981 if (!ttrace->entry_str) in trace__sys_enter()
1988 ttrace->entry_time = sample->time; in trace__sys_enter()
1989 msg = ttrace->entry_str; in trace__sys_enter()
1998 fprintf(trace->output, "%-70s\n", ttrace->entry_str); in trace__sys_enter()
2001 ttrace->entry_pending = true; in trace__sys_enter()
2003 ttrace->filename.pending_open = false; in trace__sys_enter()
2025 struct thread_trace *ttrace; in trace__sys_exit() local
2031 ttrace = thread__trace(thread, trace->output); in trace__sys_exit()
2032 if (ttrace == NULL) in trace__sys_exit()
2036 thread__update_stats(ttrace, id, sample); in trace__sys_exit()
2040 if (id == trace->audit.open_id && ret >= 0 && ttrace->filename.pending_open) { in trace__sys_exit()
2041 trace__set_fd_pathname(thread, ret, ttrace->filename.name); in trace__sys_exit()
2042 ttrace->filename.pending_open = false; in trace__sys_exit()
2046 ttrace->exit_time = sample->time; in trace__sys_exit()
2048 if (ttrace->entry_time) { in trace__sys_exit()
2049 duration = sample->time - ttrace->entry_time; in trace__sys_exit()
2060 if (ttrace->entry_pending) { in trace__sys_exit()
2061 fprintf(trace->output, "%-70s", ttrace->entry_str); in trace__sys_exit()
2086 ttrace->entry_pending = false; in trace__sys_exit()
2098 struct thread_trace *ttrace; in trace__vfs_getname() local
2107 ttrace = thread__priv(thread); in trace__vfs_getname()
2108 if (!ttrace) in trace__vfs_getname()
2113 if (ttrace->filename.namelen < filename_len) { in trace__vfs_getname()
2114 char *f = realloc(ttrace->filename.name, filename_len + 1); in trace__vfs_getname()
2119 ttrace->filename.namelen = filename_len; in trace__vfs_getname()
2120 ttrace->filename.name = f; in trace__vfs_getname()
2123 strcpy(ttrace->filename.name, filename); in trace__vfs_getname()
2124 ttrace->filename.pending_open = true; in trace__vfs_getname()
2126 if (!ttrace->filename.ptr) in trace__vfs_getname()
2129 entry_str_len = strlen(ttrace->entry_str); in trace__vfs_getname()
2139 to_move = entry_str_len - ttrace->filename.entry_str_pos + 1; /* \0 */ in trace__vfs_getname()
2140 pos = ttrace->entry_str + ttrace->filename.entry_str_pos; in trace__vfs_getname()
2144 ttrace->filename.ptr = 0; in trace__vfs_getname()
2145 ttrace->filename.entry_str_pos = 0; in trace__vfs_getname()
2159 struct thread_trace *ttrace = thread__trace(thread, trace->output); in trace__sched_stat_runtime() local
2161 if (ttrace == NULL) in trace__sched_stat_runtime()
2164 ttrace->runtime_ms += runtime_ms; in trace__sched_stat_runtime()
2228 struct thread_trace *ttrace; in trace__pgfault() local
2232 ttrace = thread__trace(thread, trace->output); in trace__pgfault()
2233 if (ttrace == NULL) in trace__pgfault()
2237 ttrace->pfmaj++; in trace__pgfault()
2239 ttrace->pfmin++; in trace__pgfault()
2839 static size_t thread__dump_stats(struct thread_trace *ttrace, in thread__dump_stats() argument
2845 struct int_node *inode = intlist__first(ttrace->syscall_stats); in thread__dump_stats()
2897 struct thread_trace *ttrace = thread__priv(thread); in trace__fprintf_one_thread() local
2900 if (ttrace == NULL) in trace__fprintf_one_thread()
2903 ratio = (double)ttrace->nr_events / trace->nr_events * 100.0; in trace__fprintf_one_thread()
2906 printed += fprintf(fp, "%lu events, ", ttrace->nr_events); in trace__fprintf_one_thread()
2908 if (ttrace->pfmaj) in trace__fprintf_one_thread()
2909 printed += fprintf(fp, ", %lu majfaults", ttrace->pfmaj); in trace__fprintf_one_thread()
2910 if (ttrace->pfmin) in trace__fprintf_one_thread()
2911 printed += fprintf(fp, ", %lu minfaults", ttrace->pfmin); in trace__fprintf_one_thread()
2912 printed += fprintf(fp, ", %.3f msec\n", ttrace->runtime_ms); in trace__fprintf_one_thread()
2913 printed += thread__dump_stats(ttrace, trace, fp); in trace__fprintf_one_thread()