Lines Matching refs:ttrace

1285 	struct thread_trace *ttrace =  zalloc(sizeof(struct thread_trace));  in thread_trace__new()  local
1287 if (ttrace) { in thread_trace__new()
1288 ttrace->files.max = -1; in thread_trace__new()
1289 ttrace->syscall_stats = intlist__new(NULL); in thread_trace__new()
1292 return ttrace; in thread_trace__new()
1297 struct thread_trace *ttrace; in thread__trace() local
1308 ttrace = thread__priv(thread); in thread__trace()
1309 ++ttrace->nr_events; in thread__trace()
1311 return ttrace; in thread__trace()
1322 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__set_ret_scnprintf() local
1324 ttrace->ret_scnprintf = ret_scnprintf; in syscall_arg__set_ret_scnprintf()
1332 static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int fd) in thread_trace__files_entry() argument
1337 if (fd > ttrace->files.max) { in thread_trace__files_entry()
1338 struct file *nfiles = realloc(ttrace->files.table, (fd + 1) * sizeof(struct file)); in thread_trace__files_entry()
1343 if (ttrace->files.max != -1) { in thread_trace__files_entry()
1344 memset(nfiles + ttrace->files.max + 1, 0, in thread_trace__files_entry()
1345 (fd - ttrace->files.max) * sizeof(struct file)); in thread_trace__files_entry()
1350 ttrace->files.table = nfiles; in thread_trace__files_entry()
1351 ttrace->files.max = fd; in thread_trace__files_entry()
1354 return ttrace->files.table + fd; in thread_trace__files_entry()
1364 struct thread_trace *ttrace = thread__priv(thread); in trace__set_fd_pathname() local
1365 struct file *file = thread_trace__files_entry(ttrace, fd); in trace__set_fd_pathname()
1408 struct thread_trace *ttrace = thread__priv(thread); in thread__fd_path() local
1410 if (ttrace == NULL || trace->fd_path_disabled) in thread__fd_path()
1416 if ((fd > ttrace->files.max || ttrace->files.table[fd].pathname == NULL)) { in thread__fd_path()
1424 return ttrace->files.table[fd].pathname; in thread__fd_path()
1461 struct thread_trace *ttrace = thread__priv(arg->thread); in syscall_arg__scnprintf_close_fd() local
1463 if (ttrace && fd >= 0 && fd <= ttrace->files.max) in syscall_arg__scnprintf_close_fd()
1464 zfree(&ttrace->files.table[fd].pathname); in syscall_arg__scnprintf_close_fd()
1472 struct thread_trace *ttrace = thread__priv(thread); in thread__set_filename_pos() local
1474 ttrace->filename.ptr = ptr; in thread__set_filename_pos()
1475 ttrace->filename.entry_str_pos = bf - ttrace->entry_str; in thread__set_filename_pos()
2005 struct thread_trace *ttrace = thread__priv(thread); in syscall__scnprintf_args() local
2012 ttrace->ret_scnprintf = NULL; in syscall__scnprintf_args()
2151 static void thread__update_stats(struct thread *thread, struct thread_trace *ttrace, argument
2158 inode = intlist__findnew(ttrace->syscall_stats, id);
2175 if (ttrace->entry_time && sample->time > ttrace->entry_time)
2176 duration = sample->time - ttrace->entry_time;
2208 struct thread_trace *ttrace; local
2215 ttrace = thread__priv(trace->current);
2217 if (!ttrace->entry_pending)
2220 …printed = trace__fprintf_entry_head(trace, trace->current, 0, false, ttrace->entry_time, trace->o…
2221 printed += len = fprintf(trace->output, "%s)", ttrace->entry_str);
2228 ttrace->entry_pending = false;
2297 struct thread_trace *ttrace; local
2303 ttrace = thread__trace(thread, trace->output);
2304 if (ttrace == NULL)
2311 if (ttrace->entry_str == NULL) {
2312 ttrace->entry_str = malloc(trace__entry_str_size);
2313 if (!ttrace->entry_str)
2331 ttrace->entry_time = sample->time;
2332 msg = ttrace->entry_str;
2342 trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output);
2343 printed = fprintf(trace->output, "%s)", ttrace->entry_str);
2349 ttrace->entry_pending = true;
2351 ttrace->filename.pending_open = false;
2367 struct thread_trace *ttrace; local
2379 ttrace = thread__trace(thread, trace->output);
2384 if (ttrace == NULL)
2444 struct thread_trace *ttrace; local
2450 ttrace = thread__trace(thread, trace->output);
2451 if (ttrace == NULL)
2459 thread__update_stats(thread, ttrace, id, sample, ret, trace->errno_summary);
2461 if (!trace->fd_path_disabled && sc->is_open && ret >= 0 && ttrace->filename.pending_open) {
2462 trace__set_fd_pathname(thread, ret, ttrace->filename.name);
2463 ttrace->filename.pending_open = false;
2467 if (ttrace->entry_time) {
2468 duration = sample->time - ttrace->entry_time;
2487 …trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace-…
2489 if (ttrace->entry_pending) {
2490 printed = fprintf(trace->output, "%s", ttrace->entry_str);
2522 else if (ttrace->ret_scnprintf) {
2529 ttrace->ret_scnprintf(bf, sizeof(bf), &arg);
2530 ttrace->ret_scnprintf = NULL;
2560 ttrace->entry_pending = false;
2572 struct thread_trace *ttrace; local
2581 ttrace = thread__priv(thread);
2582 if (!ttrace)
2589 if (ttrace->filename.namelen < filename_len) {
2590 char *f = realloc(ttrace->filename.name, filename_len + 1);
2595 ttrace->filename.namelen = filename_len;
2596 ttrace->filename.name = f;
2599 strcpy(ttrace->filename.name, filename);
2600 ttrace->filename.pending_open = true;
2602 if (!ttrace->filename.ptr)
2605 entry_str_len = strlen(ttrace->entry_str);
2615 to_move = entry_str_len - ttrace->filename.entry_str_pos + 1; /* \0 */
2616 pos = ttrace->entry_str + ttrace->filename.entry_str_pos;
2620 ttrace->filename.ptr = 0;
2621 ttrace->filename.entry_str_pos = 0;
2637 struct thread_trace *ttrace = thread__trace(thread, trace->output); local
2639 if (ttrace == NULL)
2642 ttrace->runtime_ms += runtime_ms;
2878 struct thread_trace *ttrace; local
2893 ttrace = thread__trace(thread, trace->output);
2894 if (ttrace == NULL)
2898 ttrace->pfmaj++;
2900 ttrace->pfmin++;
4326 static size_t thread__dump_stats(struct thread_trace *ttrace, argument
4332 DECLARE_RESORT_RB_INTLIST(syscall_stats, ttrace->syscall_stats);
4382 struct thread_trace *ttrace = thread__priv(thread); local
4385 if (ttrace == NULL)
4388 ratio = (double)ttrace->nr_events / trace->nr_events * 100.0;
4391 printed += fprintf(fp, "%lu events, ", ttrace->nr_events);
4393 if (ttrace->pfmaj)
4394 printed += fprintf(fp, ", %lu majfaults", ttrace->pfmaj);
4395 if (ttrace->pfmin)
4396 printed += fprintf(fp, ", %lu minfaults", ttrace->pfmin);
4398 printed += fprintf(fp, ", %.3f msec\n", ttrace->runtime_ms);
4402 printed += thread__dump_stats(ttrace, trace, fp);
4407 static unsigned long thread__nr_events(struct thread_trace *ttrace) argument
4409 return ttrace ? ttrace->nr_events : 0;