}
for (i = 0; i < log->nr_samples; i++)
- fprintf(f, "%lu, %lu\n", log->log[i].time, log->log[i].val);
+ fprintf(f, "%lu, %lu, %u\n", log->log[i].time, log->log[i].val, log->log[i].ddir);
fclose(f);
free(log->log);
if (setup_rate(td))
goto err;
- if (write_lat_log)
- setup_log(&td->lat_log);
+ if (write_lat_log) {
+ setup_log(&td->slat_log);
+ setup_log(&td->clat_log);
+ }
if (write_bw_log)
setup_log(&td->bw_log);
}
static void add_log_sample(struct thread_data *td, struct io_log *iolog,
- unsigned long val)
+ unsigned long val, int ddir)
{
if (iolog->nr_samples == iolog->max_samples) {
int new_size = sizeof(struct io_sample) * iolog->max_samples*2;
}
iolog->log[iolog->nr_samples].val = val;
- iolog->log[iolog->nr_samples].time = mtime_since_now(&td->start);
+ iolog->log[iolog->nr_samples].time = mtime_since_now(&td->epoch);
+ iolog->log[iolog->nr_samples].ddir = ddir;
iolog->nr_samples++;
}
{
add_stat_sample(&td->clat_stat[ddir], msec);
- if (td->lat_log)
- add_log_sample(td, td->lat_log, msec);
+ if (td->clat_log)
+ add_log_sample(td, td->clat_log, msec, ddir);
}
static void add_slat_sample(struct thread_data *td, int ddir,unsigned long msec)
{
add_stat_sample(&td->slat_stat[ddir], msec);
+
+ if (td->slat_log)
+ add_log_sample(td, td->slat_log, msec, ddir);
}
static void add_bw_sample(struct thread_data *td, int ddir)
add_stat_sample(&td->bw_stat[ddir], rate);
if (td->bw_log)
- add_log_sample(td, td->bw_log, rate);
+ add_log_sample(td, td->bw_log, rate, ddir);
gettimeofday(&td->stat_sample_time[ddir], NULL);
td->stat_io_bytes[ddir] = td->this_io_bytes[ddir];
if (td->bw_log)
finish_log(td, td->bw_log, "bw");
- if (td->lat_log)
- finish_log(td, td->lat_log, "lat");
+ if (td->slat_log)
+ finish_log(td, td->slat_log, "slat");
+ if (td->clat_log)
+ finish_log(td, td->clat_log, "clat");
if (exitall_on_terminate)
terminate_threads(td->groupid);
PLOT_LINE=""
for i in *bw.log; do
+ if [ ! -r $i ]; then
+ continue
+ fi
if [ "$PLOT_LINE"x != "x" ]; then
PLOT_LINE=$PLOT_LINE", "
fi
PLOT_LINE=$PLOT_LINE"'$i' with lines"
done
-if [ "$PLOT_LINE"x == "x" ]; then
- exit 0
+if [ "$PLOT_LINE"x != "x" ]; then
+ echo Making bw logs
+ echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KiB/sec'; set terminal png; set output '$TITLE-bw.png'; plot " $PLOT_LINE | gnuplot -
fi
-echo "set title 'Bandwidth - $TITLE'; set xlabel 'time (msec)'; set ylabel 'KiB/sec'; set terminal png; set output '$TITLE-bw.png'; plot " $PLOT_LINE | gnuplot -
-
PLOT_LINE=""
-for i in *lat.log; do
+for i in *slat.log; do
+ if [ ! -r $i ]; then
+ continue
+ fi
if [ "$PLOT_LINE"x != "x" ]; then
PLOT_LINE=$PLOT_LINE", "
fi
PLOT_LINE=$PLOT_LINE"'$i' with lines"
done
-if [ "$PLOT_LINE"x == "x" ]; then
- exit 0
+if [ "$PLOT_LINE"x != "x" ]; then
+ echo Making slat logs $PLOT_LINE
+ echo "set title 'Submission latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-slat.png'; plot " $PLOT_LINE | gnuplot -
fi
-echo "set title 'Latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-lat.png'; plot " $PLOT_LINE | gnuplot -
+PLOT_LINE=""
+for i in *clat.log; do
+ if [ ! -r $i ]; then
+ continue
+ fi
+ if [ "$PLOT_LINE"x != "x" ]; then
+ PLOT_LINE=$PLOT_LINE", "
+ fi
+
+ PLOT_LINE=$PLOT_LINE"'$i' with lines"
+done
+
+if [ "$PLOT_LINE"x != "x" ]; then
+ echo Making clat logs $PLOT_LINE
+ echo "set title 'Completion latency - $TITLE'; set xlabel 'time (msec)'; set ylabel 'latency (msec)'; set terminal png; set output '$TITLE-clat.png'; plot " $PLOT_LINE | gnuplot -
+fi