• Home
  • Raw
  • Download

Lines Matching full:trace

53  * Trace categories
81 * Basic trace actions
115 * Trace actions in full. Additionally, read or write is masked
142 * The trace itself
155 __u16 pdu_len; /* length of data after this trace */
181 u64 get_record_time(struct trace *trace) in get_record_time() argument
183 return trace->io->time; in get_record_time()
361 static void handle_notify(struct trace *trace) in handle_notify() argument
363 struct blk_io_trace *io = trace->io; in handle_notify()
380 trace->start_timestamp = io->time; in handle_notify()
381 trace->abs_start_time.tv_sec = two32[0]; in handle_notify()
382 trace->abs_start_time.tv_nsec = two32[1]; in handle_notify()
383 if (trace->abs_start_time.tv_nsec < 0) { in handle_notify()
384 trace->abs_start_time.tv_sec--; in handle_notify()
385 trace->abs_start_time.tv_nsec += 1000000000; in handle_notify()
389 int next_record(struct trace *trace) in next_record() argument
391 int skip = trace->io->pdu_len; in next_record()
394 trace->cur += sizeof(*trace->io) + skip; in next_record()
395 offset = trace->cur - trace->start; in next_record()
396 if (offset >= trace->len) in next_record()
399 trace->io = (struct blk_io_trace *)trace->cur; in next_record()
403 void first_record(struct trace *trace) in first_record() argument
405 trace->cur = trace->start; in first_record()
406 trace->io = (struct blk_io_trace *)trace->cur; in first_record()
426 u64 find_last_time(struct trace *trace) in find_last_time() argument
428 char *p = trace->start + trace->len; in find_last_time()
433 if (trace->len < sizeof(*trace->io)) in find_last_time()
435 p -= sizeof(*trace->io); in find_last_time()
436 while (p >= trace->start) { in find_last_time()
439 u64 offset = p - trace->start; in find_last_time()
440 if (offset + sizeof(*test) + test->pdu_len == trace->len) { in find_last_time()
452 first_record(trace); in find_last_time()
454 if (is_io_event(trace->io)) in find_last_time()
455 found = trace->io->time; in find_last_time()
456 if (next_record(trace)) in find_last_time()
459 first_record(trace); in find_last_time()
463 static int parse_fio_bank_message(struct trace *trace, u64 *bank_ret, u64 *offset_ret, in parse_fio_bank_message() argument
469 struct blk_io_trace *test = trace->io; in parse_fio_bank_message()
520 static struct dev_info *lookup_dev(struct trace *trace, struct blk_io_trace *io) in lookup_dev() argument
526 for (i = 0; i < trace->num_devices; i++) { in lookup_dev()
527 if (trace->devices[i].device == dev) { in lookup_dev()
528 di = trace->devices + i; in lookup_dev()
532 i = trace->num_devices++; in lookup_dev()
534 fprintf(stderr, "Trace contains too many devices (%d)\n", i); in lookup_dev()
537 di = trace->devices + i; in lookup_dev()
543 static void map_devices(struct trace *trace) in map_devices() argument
550 first_record(trace); in map_devices()
552 if (!(trace->io->action & BLK_TC_ACT(BLK_TC_NOTIFY))) { in map_devices()
553 di = lookup_dev(trace, trace->io); in map_devices()
554 found = trace->io->sector << 9; in map_devices()
558 found += trace->io->bytes; in map_devices()
562 if (next_record(trace)) in map_devices()
565 first_record(trace); in map_devices()
566 for (i = 0; i < trace->num_devices; i++) { in map_devices()
567 di = trace->devices + i; in map_devices()
573 static u64 map_io(struct trace *trace, struct blk_io_trace *io) in map_io() argument
575 struct dev_info *di = lookup_dev(trace, io); in map_io()
576 u64 val = trace->io->sector << 9; in map_io()
580 void find_extreme_offsets(struct trace *trace, u64 *min_ret, u64 *max_ret, u64 *max_bank_ret, in find_extreme_offsets() argument
589 map_devices(trace); in find_extreme_offsets()
591 first_record(trace); in find_extreme_offsets()
593 if (!(trace->io->action & BLK_TC_ACT(BLK_TC_NOTIFY))) { in find_extreme_offsets()
594 found = map_io(trace, trace->io); in find_extreme_offsets()
598 found += trace->io->bytes; in find_extreme_offsets()
604 if (!parse_fio_bank_message(trace, &bank, in find_extreme_offsets()
612 if (next_record(trace)) in find_extreme_offsets()
615 first_record(trace); in find_extreme_offsets()
622 static void check_io_types(struct trace *trace) in check_io_types() argument
624 struct blk_io_trace *io = trace->io; in check_io_types()
630 trace->found_completion = 1; in check_io_types()
633 trace->found_issue = 1; in check_io_types()
636 trace->found_queue = 1; in check_io_types()
643 int filter_outliers(struct trace *trace, u64 min_offset, u64 max_offset, in filter_outliers() argument
656 first_record(trace); in filter_outliers()
658 check_io_types(trace); in filter_outliers()
659 if (!(trace->io->action & BLK_TC_ACT(BLK_TC_NOTIFY)) && in filter_outliers()
660 (trace->io->action & BLK_TA_MASK) == __BLK_TA_QUEUE) { in filter_outliers()
661 u64 off = map_io(trace, trace->io) - min_offset; in filter_outliers()
668 off += trace->io->bytes; in filter_outliers()
674 if (next_record(trace)) in filter_outliers()
677 first_record(trace); in filter_outliers()
790 argc = count * 2; /* {"-i", trace } */ in dump_traces()
874 * files for a named trace in find_trace_file()
878 struct tracelist trace = {0 ,NULL}; in find_trace_file() local
882 ret = asprintf(&trace.name, "%*s.blktrace.0", len, filename); in find_trace_file()
887 free(trace.name); in find_trace_file()
891 ret = dump_traces(&trace, 1, dumpfile); in find_trace_file()
893 free(trace.name); in find_trace_file()
896 free(trace.name); in find_trace_file()
901 struct trace *open_trace(char *filename) in open_trace()
907 struct trace *trace; in open_trace() local
910 trace = calloc(1, sizeof(*trace)); in open_trace()
911 if (!trace) { in open_trace()
912 fprintf(stderr, "unable to allocate memory for trace\n"); in open_trace()
918 fprintf(stderr, "Unable to find trace file %s\n", filename); in open_trace()
925 fprintf(stderr, "Unable to open trace file %s err %s\n", filename, strerror(errno)); in open_trace()
935 fprintf(stderr, "Unable to mmap trace file %s, err %s\n", filename, strerror(errno)); in open_trace()
938 trace->fd = fd; in open_trace()
939 trace->len = st.st_size; in open_trace()
940 trace->start = p; in open_trace()
941 trace->cur = p; in open_trace()
942 trace->io = (struct blk_io_trace *)p; in open_trace()
943 return trace; in open_trace()
948 free(trace); in open_trace()
951 static inline int tput_event(struct trace *trace) in tput_event() argument
953 if (trace->found_completion) in tput_event()
955 if (trace->found_issue) in tput_event()
957 if (trace->found_queue) in tput_event()
976 static inline int io_event(struct trace *trace) in io_event() argument
980 if (trace->found_queue) in io_event()
982 if (trace->found_issue) in io_event()
984 if (trace->found_completion) in io_event()
990 void add_tput(struct trace *trace, struct graph_line_data *writes_gld, in add_tput() argument
993 struct blk_io_trace *io = trace->io; in add_tput()
1001 if (action != tput_event(trace)) in add_tput()
1052 void add_io(struct trace *trace, struct trace_file *tf) in add_io() argument
1054 struct blk_io_trace *io = trace->io; in add_io()
1064 if (action != io_event(trace)) in add_io()
1067 offset = map_io(trace, io); in add_io()
1088 void add_pending_io(struct trace *trace, struct graph_line_data *gld) in add_pending_io() argument
1091 struct blk_io_trace *io = trace->io; in add_pending_io()
1102 if (trace->found_issue || trace->found_completion) { in add_pending_io()
1103 pio = hash_queued_io(trace->io); in add_pending_io()
1108 if (pio && !trace->found_issue) { in add_pending_io()
1123 pio = hash_dispatched_io(trace->io); in add_pending_io()
1127 if (!trace->found_completion) { in add_pending_io()
1145 void add_completed_io(struct trace *trace, in add_completed_io() argument
1148 struct blk_io_trace *io = trace->io; in add_completed_io()
1163 pio = hash_completed_io(trace->io); in add_completed_io()
1185 void add_iop(struct trace *trace, struct graph_line_data *gld) in add_iop() argument
1187 struct blk_io_trace *io = trace->io; in add_iop()
1195 if (action != tput_event(trace)) in add_iop()
1205 void check_record(struct trace *trace) in check_record() argument
1207 handle_notify(trace); in check_record()