Created execution trace function to be called by every function if tracerOn is true.