c84264bb398c51438bb5230fc6b4a2a75a5bd923
Stefan Schuermans rename: lwproctrace -> upro...

Stefan Schuermans authored 4 years ago

1) #include "timing.h"
2) 
3) #include <uproctrace.pb-c.h>
4) 
5) #include <time.h>
6) 
7) static void uptev_timing_clock_gettime(clockid_t clockid,
Stefan Schuermans formatting

Stefan Schuermans authored 4 years ago

8)                                        struct _Uproctrace__Timespec *tsp) {
Stefan Schuermans rename: lwproctrace -> upro...

Stefan Schuermans authored 4 years ago

9)   struct timespec ts;
10)   clock_gettime(clockid, &ts);
11)   tsp->sec = ts.tv_sec;
12)   tsp->has_nsec = 1;
13)   tsp->nsec = ts.tv_nsec;
14) }
15) 
16) void uptev_timing_get_timestamp(struct _Uproctrace__Timespec *timestamp) {
17)   uptev_timing_clock_gettime(CLOCK_REALTIME, timestamp);
18) }
19) 
Stefan Schuermans formatting

Stefan Schuermans authored 4 years ago

20) void uptev_timing_get_proc_cpu_time(
21)     struct _Uproctrace__Timespec *proc_cpu_time) {