* [PATCH] Fix Windows local time
@ 2017-12-14 1:19 Jeff Furlong
2017-12-14 16:10 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Furlong @ 2017-12-14 1:19 UTC (permalink / raw)
To: fio
The fio summary output shows when the job completed, but references system time on Windows. On Linux, local time (such as with time zone specifics) is referenced. This patch converts Windows system time to local time.
Before:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=69.6MiB/s,w=0KiB/s][r=17.8k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=1360: Wed Dec 13 23:21:16 2017 <--System Time
After:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=73.2MiB/s,w=0KiB/s][r=18.7k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=8088: Wed Dec 13 15:22:07 2017 <--Local Time
Regards,
Jeff
diff --git a/os/windows/posix.c b/os/windows/posix.c
index 00f03355..17e18a1f 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -228,12 +228,14 @@ void Time_tToSystemTime(time_t dosTime, SYSTEMTIME *systemTime)
{
FILETIME utcFT;
LONGLONG jan1970;
+ SYSTEMTIME tempSystemTime;
jan1970 = Int32x32To64(dosTime, 10000000) + 116444736000000000;
utcFT.dwLowDateTime = (DWORD)jan1970;
utcFT.dwHighDateTime = jan1970 >> 32;
- FileTimeToSystemTime((FILETIME*)&utcFT, systemTime);
+ FileTimeToSystemTime((FILETIME*)&utcFT, &tempSystemTime);
+ SystemTimeToTzSpecificLocalTime(NULL, &tempSystemTime, systemTime);
}
char* ctime_r(const time_t *t, char *buf)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix Windows local time
2017-12-14 1:19 [PATCH] Fix Windows local time Jeff Furlong
@ 2017-12-14 16:10 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-12-14 16:10 UTC (permalink / raw)
To: Jeff Furlong, fio
On 12/13/2017 06:19 PM, Jeff Furlong wrote:
> The fio summary output shows when the job completed, but references system time on Windows. On Linux, local time (such as with time zone specifics) is referenced. This patch converts Windows system time to local time.
>
> Before:
> fio-3.2-72-ge80d-dirty
> Starting 1 thread
> Jobs: 1 (f=0): [f(1)][100.0%][r=69.6MiB/s,w=0KiB/s][r=17.8k,w=0 IOPS][eta 00m:00s]
> test: (groupid=0, jobs=1): err= 0: pid=1360: Wed Dec 13 23:21:16 2017 <--System Time
>
> After:
> fio-3.2-72-ge80d-dirty
> Starting 1 thread
> Jobs: 1 (f=0): [f(1)][100.0%][r=73.2MiB/s,w=0KiB/s][r=18.7k,w=0 IOPS][eta 00m:00s]
> test: (groupid=0, jobs=1): err= 0: pid=8088: Wed Dec 13 15:22:07 2017 <--Local Time
Applied, thanks Jeff.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-14 16:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 1:19 [PATCH] Fix Windows local time Jeff Furlong
2017-12-14 16:10 ` Jens Axboe
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.