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

instrument/daq: Add an explicit time column to the DAQ measurements

Add the monotonic clock time to the energy measurements to help
correlate the measurement with those of other collectors, like
FtraceCollector or LogcatCollector.
This commit is contained in:
Javi Merino
2020-02-11 18:18:22 +00:00
committed by Marc Bonnici
parent 72ded188fa
commit 92e16ee873
5 changed files with 67 additions and 5 deletions

View File

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

View File

@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
int ret;
struct timespec tp;
ret = clock_gettime(CLOCK_MONOTONIC, &tp);
if (ret) {
perror("clock_gettime()");
return EXIT_FAILURE;
}
printf("%ld.%ld\n", tp.tv_sec, tp.tv_nsec);
return EXIT_SUCCESS;
}