All of lore.kernel.org
 help / color / mirror / Atom feed
* fio Windows Time
@ 2017-07-26 23:45 Jeff Furlong
  2017-07-28  6:31 ` Sitsofe Wheeler
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Furlong @ 2017-07-26 23:45 UTC (permalink / raw)
  To: fio

Hi All,
When fio prints a summary output in Linux, the timestamp appears correct with the Linux system date/time.  However, on Windows, the time reported seems to be incorrect (wrong time zone)?

    test_job: (groupid=0, jobs=1): err= 0: pid=1928: Tue Jul 25 21:24:23 2017

It looks like the fio timestamp is reported by stat.c, show_thread_status_normal():

    memset(time_buf, 0, sizeof(time_buf));
    
    time(&time_p);
    os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf));

    if (!ts->error) {
        log_buf(out, "%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",
            ts->name, ts->groupid, ts->members,
            ts->error, (int) ts->pid, time_buf);

Is there a better way to query system time on Windows platforms?  Thanks.

Regards,
Jeff


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: fio Windows Time
  2017-07-26 23:45 fio Windows Time Jeff Furlong
@ 2017-07-28  6:31 ` Sitsofe Wheeler
  0 siblings, 0 replies; 2+ messages in thread
From: Sitsofe Wheeler @ 2017-07-28  6:31 UTC (permalink / raw)
  To: Jeff Furlong; +Cc: fio

Hi,

On 27 July 2017 at 00:45, Jeff Furlong <jeff.furlong@wdc.com> wrote:
>
> When fio prints a summary output in Linux, the timestamp appears correct with the Linux system date/time.  However, on Windows, the time reported seems to be incorrect (wrong time zone)?
>
>     test_job: (groupid=0, jobs=1): err= 0: pid=1928: Tue Jul 25 21:24:23 2017
>
> It looks like the fio timestamp is reported by stat.c, show_thread_status_normal():
>
>     memset(time_buf, 0, sizeof(time_buf));
>
>     time(&time_p);
>     os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf));
>
>     if (!ts->error) {
>         log_buf(out, "%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",
>             ts->name, ts->groupid, ts->members,
>             ts->error, (int) ts->pid, time_buf);
>
> Is there a better way to query system time on Windows platforms?  Thanks.

What time were you expecting, what time was printed, what timezone are
you in, which version of fio and which version of Windows? I've just
done a quick run with fio-2.99 Windows 2012 R2 and found the time fio
prints on Windows appears to be UTC.

The Windows code that constructs the string is ctime_r in
os/windows/posix.h
(https://github.com/axboe/fio/blob/fio-2.99/os/windows/posix.c#L239 ).
If you wanted to print timezone information at a guess this would
involve getting and parsing GetTimeZoneInformation
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms724421(v=vs.85).aspx
) and ensuring the time you retrieved was the local system one.

-- 
Sitsofe | http://sucs.org/~sits/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-28  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 23:45 fio Windows Time Jeff Furlong
2017-07-28  6:31 ` Sitsofe Wheeler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.