Move ftrace format_parser into its own subdirectory

Unlike the rest of ftrace code, which is intended only for
Linux-based systems, the parser code is needed on Windows as
well  (for minor presubmit-related tasks).
The usual problem is that we can't easily mix Linux-only and
cross-platform code in the same BUILD.gn file, because one single
target dependency makes the other targets in the same file visible
to the "all" target.
We fix this by moving format_parser into its own folder with a
dedicated BUILD.gn file, which is platform neutral.
No production code was harmed while writing this refactoring.

Bug: 174454879
Change-Id: Ib3fca8ee6a3b517b5e02517f6925e04138b73cfb
diff --git a/Android.bp b/Android.bp
index 95f5392..f45b323 100644
--- a/Android.bp
+++ b/Android.bp
@@ -513,7 +513,7 @@
     ":perfetto_src_traced_probes_common_common",
     ":perfetto_src_traced_probes_data_source",
     ":perfetto_src_traced_probes_filesystem_filesystem",
-    ":perfetto_src_traced_probes_ftrace_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
     ":perfetto_src_traced_probes_ftrace_ftrace",
     ":perfetto_src_traced_probes_initial_display_state_initial_display_state",
     ":perfetto_src_traced_probes_metatrace_metatrace",
@@ -1053,7 +1053,7 @@
     ":perfetto_src_traced_probes_common_common",
     ":perfetto_src_traced_probes_data_source",
     ":perfetto_src_traced_probes_filesystem_filesystem",
-    ":perfetto_src_traced_probes_ftrace_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
     ":perfetto_src_traced_probes_ftrace_ftrace",
     ":perfetto_src_traced_probes_initial_display_state_initial_display_state",
     ":perfetto_src_traced_probes_metatrace_metatrace",
@@ -1307,7 +1307,7 @@
     ":perfetto_src_traced_probes_common_common",
     ":perfetto_src_traced_probes_data_source",
     ":perfetto_src_traced_probes_filesystem_filesystem",
-    ":perfetto_src_traced_probes_ftrace_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
     ":perfetto_src_traced_probes_ftrace_ftrace",
     ":perfetto_src_traced_probes_initial_display_state_initial_display_state",
     ":perfetto_src_traced_probes_metatrace_metatrace",
@@ -1709,7 +1709,7 @@
     ":perfetto_src_traced_probes_common_common",
     ":perfetto_src_traced_probes_data_source",
     ":perfetto_src_traced_probes_filesystem_filesystem",
-    ":perfetto_src_traced_probes_ftrace_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
     ":perfetto_src_traced_probes_ftrace_ftrace",
     ":perfetto_src_traced_probes_ftrace_integrationtests",
     ":perfetto_src_traced_probes_ftrace_test_support",
@@ -7763,11 +7763,19 @@
   ],
 }
 
-// GN: //src/traced/probes/ftrace:format_parser
+// GN: //src/traced/probes/ftrace/format_parser:format_parser
 filegroup {
-  name: "perfetto_src_traced_probes_ftrace_format_parser",
+  name: "perfetto_src_traced_probes_ftrace_format_parser_format_parser",
   srcs: [
-    "src/traced/probes/ftrace/format_parser.cc",
+    "src/traced/probes/ftrace/format_parser/format_parser.cc",
+  ],
+}
+
+// GN: //src/traced/probes/ftrace/format_parser:unittests
+filegroup {
+  name: "perfetto_src_traced_probes_ftrace_format_parser_unittests",
+  srcs: [
+    "src/traced/probes/ftrace/format_parser/format_parser_unittest.cc",
   ],
 }
 
@@ -7924,7 +7932,6 @@
     "src/traced/probes/ftrace/cpu_stats_parser_unittest.cc",
     "src/traced/probes/ftrace/discover_vendor_tracepoints_unittest.cc",
     "src/traced/probes/ftrace/event_info_unittest.cc",
-    "src/traced/probes/ftrace/format_parser_unittest.cc",
     "src/traced/probes/ftrace/ftrace_config_muxer_unittest.cc",
     "src/traced/probes/ftrace/ftrace_config_unittest.cc",
     "src/traced/probes/ftrace/ftrace_controller_unittest.cc",
@@ -8608,7 +8615,8 @@
     ":perfetto_src_traced_probes_data_source",
     ":perfetto_src_traced_probes_filesystem_filesystem",
     ":perfetto_src_traced_probes_filesystem_unittests",
-    ":perfetto_src_traced_probes_ftrace_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
+    ":perfetto_src_traced_probes_ftrace_format_parser_unittests",
     ":perfetto_src_traced_probes_ftrace_ftrace",
     ":perfetto_src_traced_probes_ftrace_test_messages_cpp_gen",
     ":perfetto_src_traced_probes_ftrace_test_messages_lite_gen",