Lines Matching refs:ttrace

1073 	struct thread_trace *ttrace =  zalloc(sizeof(struct thread_trace));  in thread_trace__new()  local
1075 if (ttrace) { in thread_trace__new()
1076 ttrace->files.max = -1; in thread_trace__new()
1077 ttrace->syscall_stats = intlist__new(NULL); in thread_trace__new()
1080 return ttrace; in thread_trace__new()
1085 struct thread_trace *ttrace; in thread__trace() local
1096 ttrace = thread__priv(thread); in thread__trace()
1097 ++ttrace->nr_events; in thread__trace()
1099 return ttrace; in thread__trace()
1110 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__set_ret_scnprintf() local
1112 ttrace->ret_scnprintf = ret_scnprintf; in syscall_arg__set_ret_scnprintf()
1120 static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int fd) in thread_trace__files_entry() argument
1125 if (fd > ttrace->files.max) { in thread_trace__files_entry()
1126 struct file *nfiles = realloc(ttrace->files.table, (fd + 1) * sizeof(struct file)); in thread_trace__files_entry()
1131 if (ttrace->files.max != -1) { in thread_trace__files_entry()
1132 memset(nfiles + ttrace->files.max + 1, 0, in thread_trace__files_entry()
1133 (fd - ttrace->files.max) * sizeof(struct file)); in thread_trace__files_entry()
1138 ttrace->files.table = nfiles; in thread_trace__files_entry()
1139 ttrace->files.max = fd; in thread_trace__files_entry()
1142 return ttrace->files.table + fd; in thread_trace__files_entry()
1152 struct thread_trace *ttrace = thread__priv(thread); in trace__set_fd_pathname() local
1153 struct file *file = thread_trace__files_entry(ttrace, fd); in trace__set_fd_pathname()
1196 struct thread_trace *ttrace = thread__priv(thread); in thread__fd_path() local
1198 if (ttrace == NULL || trace->fd_path_disabled) in thread__fd_path()
1204 if ((fd > ttrace->files.max || ttrace->files.table[fd].pathname == NULL)) { in thread__fd_path()
1212 return ttrace->files.table[fd].pathname; in thread__fd_path()
1249 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__scnprintf_close_fd() local
1251 if (ttrace && fd >= 0 && fd <= ttrace->files.max) in syscall_arg__scnprintf_close_fd()
1252 zfree(&ttrace->files.table[fd].pathname); in syscall_arg__scnprintf_close_fd()
1260 struct thread_trace *ttrace = thread__priv(thread); in thread__set_filename_pos() local
1262 ttrace->filename.ptr = ptr; in thread__set_filename_pos()
1263 ttrace->filename.entry_str_pos = bf - ttrace->entry_str; in thread__set_filename_pos()
1722 struct thread_trace *ttrace = thread__priv(thread); in syscall__scnprintf_args() local
1729 ttrace->ret_scnprintf = NULL; in syscall__scnprintf_args()
1847 static void thread__update_stats(struct thread_trace *ttrace, in thread__update_stats() argument
1854 inode = intlist__findnew(ttrace->syscall_stats, id); in thread__update_stats()
1867 if (ttrace->entry_time && sample->time > ttrace->entry_time) in thread__update_stats()
1868 duration = sample->time - ttrace->entry_time; in thread__update_stats()
1875 struct thread_trace *ttrace; in trace__printf_interrupted_entry() local
1882 ttrace = thread__priv(trace->current); in trace__printf_interrupted_entry()
1884 if (!ttrace->entry_pending) in trace__printf_interrupted_entry()
1887 …printed = trace__fprintf_entry_head(trace, trace->current, 0, false, ttrace->entry_time, trace->o… in trace__printf_interrupted_entry()
1888 printed += len = fprintf(trace->output, "%s)", ttrace->entry_str); in trace__printf_interrupted_entry()
1895 ttrace->entry_pending = false; in trace__printf_interrupted_entry()
1956 struct thread_trace *ttrace; in trace__sys_enter() local
1962 ttrace = thread__trace(thread, trace->output); in trace__sys_enter()
1963 if (ttrace == NULL) in trace__sys_enter()
1970 if (ttrace->entry_str == NULL) { in trace__sys_enter()
1971 ttrace->entry_str = malloc(trace__entry_str_size); in trace__sys_enter()
1972 if (!ttrace->entry_str) in trace__sys_enter()
1990 ttrace->entry_time = sample->time; in trace__sys_enter()
1991 msg = ttrace->entry_str; in trace__sys_enter()
2001 trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output); in trace__sys_enter()
2002 printed = fprintf(trace->output, "%s)", ttrace->entry_str); in trace__sys_enter()
2008 ttrace->entry_pending = true; in trace__sys_enter()
2010 ttrace->filename.pending_open = false; in trace__sys_enter()
2026 struct thread_trace *ttrace; in trace__fprintf_sys_enter() local
2038 ttrace = thread__trace(thread, trace->output); in trace__fprintf_sys_enter()
2043 if (ttrace == NULL) in trace__fprintf_sys_enter()
2103 struct thread_trace *ttrace; in trace__sys_exit() local
2109 ttrace = thread__trace(thread, trace->output); in trace__sys_exit()
2110 if (ttrace == NULL) in trace__sys_exit()
2116 thread__update_stats(ttrace, id, sample); in trace__sys_exit()
2120 if (!trace->fd_path_disabled && sc->is_open && ret >= 0 && ttrace->filename.pending_open) { in trace__sys_exit()
2121 trace__set_fd_pathname(thread, ret, ttrace->filename.name); in trace__sys_exit()
2122 ttrace->filename.pending_open = false; in trace__sys_exit()
2126 if (ttrace->entry_time) { in trace__sys_exit()
2127 duration = sample->time - ttrace->entry_time; in trace__sys_exit()
2146 …trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace-… in trace__sys_exit()
2148 if (ttrace->entry_pending) { in trace__sys_exit()
2149 printed = fprintf(trace->output, "%s", ttrace->entry_str); in trace__sys_exit()
2181 else if (ttrace->ret_scnprintf) { in trace__sys_exit()
2188 ttrace->ret_scnprintf(bf, sizeof(bf), &arg); in trace__sys_exit()
2189 ttrace->ret_scnprintf = NULL; in trace__sys_exit()
2219 ttrace->entry_pending = false; in trace__sys_exit()
2231 struct thread_trace *ttrace; in trace__vfs_getname() local
2240 ttrace = thread__priv(thread); in trace__vfs_getname()
2241 if (!ttrace) in trace__vfs_getname()
2248 if (ttrace->filename.namelen < filename_len) { in trace__vfs_getname()
2249 char *f = realloc(ttrace->filename.name, filename_len + 1); in trace__vfs_getname()
2254 ttrace->filename.namelen = filename_len; in trace__vfs_getname()
2255 ttrace->filename.name = f; in trace__vfs_getname()
2258 strcpy(ttrace->filename.name, filename); in trace__vfs_getname()
2259 ttrace->filename.pending_open = true; in trace__vfs_getname()
2261 if (!ttrace->filename.ptr) in trace__vfs_getname()
2264 entry_str_len = strlen(ttrace->entry_str); in trace__vfs_getname()
2274 to_move = entry_str_len - ttrace->filename.entry_str_pos + 1; /* \0 */ in trace__vfs_getname()
2275 pos = ttrace->entry_str + ttrace->filename.entry_str_pos; in trace__vfs_getname()
2279 ttrace->filename.ptr = 0; in trace__vfs_getname()
2280 ttrace->filename.entry_str_pos = 0; in trace__vfs_getname()
2296 struct thread_trace *ttrace = thread__trace(thread, trace->output); in trace__sched_stat_runtime() local
2298 if (ttrace == NULL) in trace__sched_stat_runtime()
2301 ttrace->runtime_ms += runtime_ms; in trace__sched_stat_runtime()
2458 struct thread_trace *ttrace; in trace__pgfault() local
2473 ttrace = thread__trace(thread, trace->output); in trace__pgfault()
2474 if (ttrace == NULL) in trace__pgfault()
2478 ttrace->pfmaj++; in trace__pgfault()
2480 ttrace->pfmin++; in trace__pgfault()
3681 static size_t thread__dump_stats(struct thread_trace *ttrace, in thread__dump_stats() argument
3687 DECLARE_RESORT_RB_INTLIST(syscall_stats, ttrace->syscall_stats); in thread__dump_stats()
3727 struct thread_trace *ttrace = thread__priv(thread); in trace__fprintf_thread() local
3730 if (ttrace == NULL) in trace__fprintf_thread()
3733 ratio = (double)ttrace->nr_events / trace->nr_events * 100.0; in trace__fprintf_thread()
3736 printed += fprintf(fp, "%lu events, ", ttrace->nr_events); in trace__fprintf_thread()
3738 if (ttrace->pfmaj) in trace__fprintf_thread()
3739 printed += fprintf(fp, ", %lu majfaults", ttrace->pfmaj); in trace__fprintf_thread()
3740 if (ttrace->pfmin) in trace__fprintf_thread()
3741 printed += fprintf(fp, ", %lu minfaults", ttrace->pfmin); in trace__fprintf_thread()
3743 printed += fprintf(fp, ", %.3f msec\n", ttrace->runtime_ms); in trace__fprintf_thread()
3747 printed += thread__dump_stats(ttrace, trace, fp); in trace__fprintf_thread()
3752 static unsigned long thread__nr_events(struct thread_trace *ttrace) in thread__nr_events() argument
3754 return ttrace ? ttrace->nr_events : 0; in thread__nr_events()