Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / scsi / fnic / fnic_trace.c
index b5ac538..4826f59 100644 (file)
@@ -219,7 +219,31 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
        int buf_size = debug->buf_size;
        struct timespec val1, val2;
 
+       getnstimeofday(&val1);
        len = snprintf(debug->debug_buffer + len, buf_size - len,
+               "------------------------------------------\n"
+                "\t\tTime\n"
+               "------------------------------------------\n");
+
+       len += snprintf(debug->debug_buffer + len, buf_size - len,
+               "Current time :          [%ld:%ld]\n"
+               "Last stats reset time:  [%ld:%ld]\n"
+               "Last stats read time:   [%ld:%ld]\n"
+               "delta since last reset: [%ld:%ld]\n"
+               "delta since last read:  [%ld:%ld]\n",
+       val1.tv_sec, val1.tv_nsec,
+       stats->stats_timestamps.last_reset_time.tv_sec,
+       stats->stats_timestamps.last_reset_time.tv_nsec,
+       stats->stats_timestamps.last_read_time.tv_sec,
+       stats->stats_timestamps.last_read_time.tv_nsec,
+       timespec_sub(val1, stats->stats_timestamps.last_reset_time).tv_sec,
+       timespec_sub(val1, stats->stats_timestamps.last_reset_time).tv_nsec,
+       timespec_sub(val1, stats->stats_timestamps.last_read_time).tv_sec,
+       timespec_sub(val1, stats->stats_timestamps.last_read_time).tv_nsec);
+
+       stats->stats_timestamps.last_read_time = val1;
+
+       len += snprintf(debug->debug_buffer + len, buf_size - len,
                  "------------------------------------------\n"
                  "\t\tIO Statistics\n"
                  "------------------------------------------\n");