mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +00:00
tools/revent: recording timestamp fix
- force cast start/end timestamps to uint64_t to correct recording format issue on 32bit devices (i.e. 4 bytes timespec tv_sec written on 8 bytes memory slot)
This commit is contained in:
parent
7dce0fb208
commit
f64aaf64a0
@ -1234,11 +1234,13 @@ void record(const char *filepath, int delay, recording_mode_t mode)
|
|||||||
if (ret < 1)
|
if (ret < 1)
|
||||||
die("Could not write event count: %s", strerror(errno));
|
die("Could not write event count: %s", strerror(errno));
|
||||||
dprintf("Writing recording timestamps...\n");
|
dprintf("Writing recording timestamps...\n");
|
||||||
uint64_t usecs;
|
uint64_t secs, usecs;
|
||||||
fwrite(&start_time.tv_sec, sizeof(uint64_t), 1, fout);
|
secs = start_time.tv_sec;
|
||||||
|
fwrite(&secs, sizeof(uint64_t), 1, fout);
|
||||||
usecs = start_time.tv_nsec / 1000;
|
usecs = start_time.tv_nsec / 1000;
|
||||||
fwrite(&usecs, sizeof(uint64_t), 1, fout);
|
fwrite(&usecs, sizeof(uint64_t), 1, fout);
|
||||||
fwrite(&end_time.tv_sec, sizeof(uint64_t), 1, fout);
|
secs = end_time.tv_sec;
|
||||||
|
fwrite(&secs, sizeof(uint64_t), 1, fout);
|
||||||
usecs = end_time.tv_nsec / 1000;
|
usecs = end_time.tv_nsec / 1000;
|
||||||
ret = fwrite(&usecs, sizeof(uint64_t), 1, fout);
|
ret = fwrite(&usecs, sizeof(uint64_t), 1, fout);
|
||||||
if (ret < 1)
|
if (ret < 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user