diff options
author | syltaylor <44095554+syltaylor@users.noreply.github.com> | 2018-10-12 16:53:32 +0100 |
---|---|---|
committer | Marc Bonnici <marc.bonnici@arm.com> | 2018-10-15 09:48:02 +0100 |
commit | f64aaf64a0d9b0bd4c1a1a7ea04d69967f29fa56 (patch) | |
tree | cd03b8cc2bd80c65c486fe258077618e2cfc8ad4 | |
parent | 7dce0fb208cd26be903428908186ea16d12d00bb (diff) |
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)
-rw-r--r-- | wa/tools/revent/revent.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wa/tools/revent/revent.c b/wa/tools/revent/revent.c index ff9d16ef..4d90f35d 100644 --- a/wa/tools/revent/revent.c +++ b/wa/tools/revent/revent.c @@ -1234,11 +1234,13 @@ void record(const char *filepath, int delay, recording_mode_t mode) if (ret < 1) die("Could not write event count: %s", strerror(errno)); dprintf("Writing recording timestamps...\n"); - uint64_t usecs; - fwrite(&start_time.tv_sec, sizeof(uint64_t), 1, fout); + uint64_t secs, usecs; + secs = start_time.tv_sec; + fwrite(&secs, sizeof(uint64_t), 1, fout); usecs = start_time.tv_nsec / 1000; 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; ret = fwrite(&usecs, sizeof(uint64_t), 1, fout); if (ret < 1) |