def flush_trace_counters(self): # this is always called, the jitlog knows if it is enabled length = len(self.loop_run_counters) for i in range(length): struct = self.loop_run_counters[i] # only log if it has been executed if struct.i > 0: jl._log_jit_counter(struct) # reset the counter, flush in a later point in time will # add up the counters! struct.i = 0