Minor code cleanup in trace.cpp

* Consistent indentation

* Made functions used internally in trace.cpp static