From df666ec144adb9b3bbf44f630d5f0c08c1abbd19 Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Wed, 23 Oct 2019 11:16:23 -0700 Subject: [PATCH] fixing error which caused less than 1 rel_cpu_speed to be interpreted as 0 --- src/tracer/tracer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tracer/tracer.c b/src/tracer/tracer.c index 2fedc80..8531520 100644 --- a/src/tracer/tracer.c +++ b/src/tracer/tracer.c @@ -447,7 +447,7 @@ int run_commanded_process(hashmap * tracees, llist * tracee_list, LOG("Running Child: %d Quanta: %d instructions\n", pid, n_insns); - n_insns = n_insns_orig * (int) rel_cpu_speed; + n_insns = (int)(n_insns_orig * rel_cpu_speed); if (n_insns <= buffer_window_size) singlestepmode = 1; @@ -533,7 +533,7 @@ int run_commanded_process(hashmap * tracees, llist * tracee_list, } LOG("PTRACE CONT Error: %d\n", errno); errno = 0; - n_insns = n_insns_orig * (int) rel_cpu_speed; + n_insns = (int)(n_insns_orig * rel_cpu_speed); //assert(0); continue; }