1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-09-01 17:41:54 +01:00

instrument/daq: Use clock boottime for the time column of the energy measurements

92e16ee873 ("instrument/daq: Add an explicit time column to the DAQ
measurements") added a time column to the DAQ measurements in order to
help correlate them with those of other collectors like
FtraceCollector.  Sadly, FTrace uses CLOCK_BOOTTIME instead of
CLOCK_MONOTONIC by default.  CLOCK_MONOTONIC is like CLOCK_BOOTTIME,
except that it stops when the device suspends, which is why I hadn't
spot the issue until now.

Switch to CLOCK_BOOTTIME to get the intended behaviour of the original
commit.
This commit is contained in:
Javi Merino
2020-11-06 16:35:01 +00:00
committed by Marc Bonnici
parent 1381944e5b
commit a82db5ed37
7 changed files with 20 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
CFLAGS=-Wall --pedantic-errors -O2 -static
all: get_clock_monotonic
all: get_clock_boottime
get_clock_monotonic: get_clock_monotonic.c
get_clock_boottime: get_clock_boottime.c
$(CC) $(CFLAGS) $^ -o $@

View File

@@ -6,7 +6,7 @@ int main(void) {
int ret;
struct timespec tp;
ret = clock_gettime(CLOCK_MONOTONIC, &tp);
ret = clock_gettime(CLOCK_BOOTTIME, &tp);
if (ret) {
perror("clock_gettime()");
return EXIT_FAILURE;