trace_to_text: Refactor in preparation of userspace events json export

Extracts json export out of TraceToSystrace, so that we can add export
of userspace events in a follow-up patch.

Bug: 142222891
Change-Id: Ib75271f72a7712b00e93c2fcf76311da3f5cd070
diff --git a/Android.bp b/Android.bp
index 83e180e..80940d2 100644
--- a/Android.bp
+++ b/Android.bp
@@ -4582,6 +4582,7 @@
   srcs: [
     "tools/trace_to_text/main.cc",
     "tools/trace_to_text/symbolize_profile.cc",
+    "tools/trace_to_text/trace_to_json.cc",
     "tools/trace_to_text/trace_to_profile.cc",
     "tools/trace_to_text/trace_to_systrace.cc",
   ],