diff options
author | netblue30 <netblue30@yahoo.com> | 2018-10-20 07:50:03 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2018-10-20 07:50:03 -0400 |
commit | 1631170f028d83ff5d3313572c8ebeb920e66cf6 (patch) | |
tree | 2d0267e0b4893088803896e1759827ca4922b056 /src | |
parent | removing ldd_utils.o (diff) | |
download | firejail-1631170f028d83ff5d3313572c8ebeb920e66cf6.tar.gz firejail-1631170f028d83ff5d3313572c8ebeb920e66cf6.tar.zst firejail-1631170f028d83ff5d3313572c8ebeb920e66cf6.zip |
cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/include/common.h | 2 | ||||
-rw-r--r-- | src/lib/common.c | 39 |
2 files changed, 0 insertions, 41 deletions
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) { | |||
124 | #endif | 124 | #endif |
125 | } | 125 | } |
126 | 126 | ||
127 | void timetrace_start(void); | ||
128 | float timetrace_end(void); | ||
129 | int join_namespace(pid_t pid, char *type); | 127 | int join_namespace(pid_t pid, char *type); |
130 | int name2pid(const char *name, pid_t *pid); | 128 | int name2pid(const char *name, pid_t *pid); |
131 | char *pid_proc_comm(const pid_t pid); | 129 | 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) { | |||
286 | fclose(fp); | 286 | fclose(fp); |
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
289 | |||
290 | //************************** | ||
291 | // time trace based on getticks function | ||
292 | //************************** | ||
293 | static int tt_not_implemented = 0; // not implemented for the current architecture | ||
294 | static unsigned long long tt_1ms = 0; | ||
295 | static unsigned long long tt = 0; // start time | ||
296 | |||
297 | void timetrace_start(void) { | ||
298 | if (tt_not_implemented) | ||
299 | return; | ||
300 | unsigned long long t1 = getticks(); | ||
301 | if (t1 == 0) { | ||
302 | tt_not_implemented = 1; | ||
303 | return; | ||
304 | } | ||
305 | |||
306 | if (tt_1ms == 0) { | ||
307 | usleep(1000); // sleep 1 ms | ||
308 | unsigned long long t2 = getticks(); | ||
309 | tt_1ms = t2 - t1; | ||
310 | if (tt_1ms == 0) { | ||
311 | tt_not_implemented = 1; | ||
312 | return; | ||
313 | } | ||
314 | } | ||
315 | |||
316 | tt = getticks(); | ||
317 | } | ||
318 | |||
319 | float timetrace_end(void) { | ||
320 | if (tt_not_implemented) | ||
321 | return 0; | ||
322 | |||
323 | unsigned long long delta = getticks() - tt; | ||
324 | assert(tt_1ms); | ||
325 | |||
326 | return (float) delta / (float) tt_1ms; | ||
327 | } | ||