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:
committed by
Marc Bonnici
parent
72ded188fa
commit
92e16ee873
6
src/get_clock_monotonic/Makefile
Normal file
6
src/get_clock_monotonic/Makefile
Normal 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 $@
|
18
src/get_clock_monotonic/get_clock_monotonic.c
Normal file
18
src/get_clock_monotonic/get_clock_monotonic.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user