Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/truss/truss.h
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | struct trussinfo | ||||
FILE *outfile; | FILE *outfile; | ||||
struct timespec start_time; | struct timespec start_time; | ||||
struct threadinfo *curthread; | struct threadinfo *curthread; | ||||
LIST_HEAD(, procinfo) proclist; | LIST_HEAD(, procinfo) proclist; | ||||
}; | }; | ||||
#define timespecsubt(tvp, uvp, vvp) \ | |||||
do { \ | |||||
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ | |||||
(vvp)->tv_nsec = (tvp)->tv_nsec - (uvp)->tv_nsec; \ | |||||
if ((vvp)->tv_nsec < 0) { \ | |||||
(vvp)->tv_sec--; \ | |||||
(vvp)->tv_nsec += 1000000000; \ | |||||
} \ | |||||
} while (0) | |||||
#define timespecadd(tvp, uvp, vvp) \ | |||||
do { \ | |||||
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ | |||||
(vvp)->tv_nsec = (tvp)->tv_nsec + (uvp)->tv_nsec; \ | |||||
if ((vvp)->tv_nsec > 1000000000) { \ | |||||
(vvp)->tv_sec++; \ | |||||
(vvp)->tv_nsec -= 1000000000; \ | |||||
} \ | |||||
} while (0) |