From 1631170f028d83ff5d3313572c8ebeb920e66cf6 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 20 Oct 2018 07:50:03 -0400 Subject: cleanup --- src/include/common.h | 2 -- src/lib/common.c | 39 --------------------------------------- 2 files changed, 41 deletions(-) (limited to 'src') diff --git a/src/include/common.h b/src/include/common.h index a80ad4688..7a2b87eda 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -124,8 +124,6 @@ static inline unsigned long long getticks(void) { #endif } -void timetrace_start(void); -float timetrace_end(void); int join_namespace(pid_t pid, char *type); int name2pid(const char *name, pid_t *pid); char *pid_proc_comm(const pid_t pid); diff --git a/src/lib/common.c b/src/lib/common.c index d6dd43c4b..98fb82c11 100644 --- a/src/lib/common.c +++ b/src/lib/common.c @@ -286,42 +286,3 @@ int pid_hidepid(void) { fclose(fp); return 0; } - -//************************** -// time trace based on getticks function -//************************** -static int tt_not_implemented = 0; // not implemented for the current architecture -static unsigned long long tt_1ms = 0; -static unsigned long long tt = 0; // start time - -void timetrace_start(void) { - if (tt_not_implemented) - return; - unsigned long long t1 = getticks(); - if (t1 == 0) { - tt_not_implemented = 1; - return; - } - - if (tt_1ms == 0) { - usleep(1000); // sleep 1 ms - unsigned long long t2 = getticks(); - tt_1ms = t2 - t1; - if (tt_1ms == 0) { - tt_not_implemented = 1; - return; - } - } - - tt = getticks(); -} - -float timetrace_end(void) { - if (tt_not_implemented) - return 0; - - unsigned long long delta = getticks() - tt; - assert(tt_1ms); - - return (float) delta / (float) tt_1ms; -} -- cgit v1.2.3-70-g09d2