#define DOUBLE_TO_NANO_ULL(d) ((unsigned long long)((d) * 1000000000))
#define CHECK_MAGIC(t) (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
+u64 get_record_time(struct trace *trace)
+{
+ return trace->io->time;
+}
+
void init_io_hash_table(void)
{
int i;
gld = writes_gld;
seconds = SECONDS(io->time);
- if (seconds > gld->max_seconds)
- return;
-
gld->data[seconds].sum += io->bytes;
gld->data[seconds].count = 1;
if (action != __BLK_TA_ISSUE)
return;
- seconds = SECONDS(io->time);
- if (seconds > gld->max_seconds)
- return;
-
pio = hash_dispatched_io(trace->io);
if (!pio)
return;
ios_in_flight++;
+ seconds = SECONDS(io->time);
gld->data[seconds].sum += ios_in_flight;
gld->data[seconds].count++;
return;
seconds = SECONDS(io->time);
- if (seconds > gld->max_seconds)
- return;
-
gld->data[seconds].sum += 1;
gld->data[seconds].count = 1;
if (gld->data[seconds].sum > gld->max)
struct graph_line_data *reads_gld);
void add_pending_io(struct trace *trace, struct graph_line_data *gld);
int next_record(struct trace *trace);
+u64 get_record_time(struct trace *trace);
void first_record(struct trace *trace);
#endif
trace = tf->trace;
first_record(trace);
- while (1) {
+ do {
+ if (SECONDS(get_record_time(trace)) > tf->max_seconds)
+ continue;
check_record(trace);
add_tput(trace, tf->tput_writes_gld, tf->tput_reads_gld);
add_iop(trace, tf->iop_gld);
add_io(trace, tf);
add_pending_io(trace, tf->queue_depth_gld);
add_completed_io(trace, tf->latency_gld);
- ret = next_record(trace);
- if (ret)
- break;
- }
+ } while (!(ret = next_record(trace)));
}
list_for_each_entry(tf, &all_traces, list) {
trace = tf->trace;