tp: move util related sources to util build file
Change-Id: I6428504797d76faed0008a1f53f10abdf6f7da5e
diff --git a/Android.bp b/Android.bp
index 965e404..d985dfd 100644
--- a/Android.bp
+++ b/Android.bp
@@ -6441,14 +6441,6 @@
],
}
-// GN: //src/trace_processor:descriptors
-filegroup {
- name: "perfetto_src_trace_processor_descriptors",
- srcs: [
- "src/trace_processor/util/descriptors.cc",
- ],
-}
-
// GN: //src/trace_processor:export_json
filegroup {
name: "perfetto_src_trace_processor_export_json",
@@ -6494,14 +6486,6 @@
],
}
-// GN: //src/trace_processor:protozero_to_text
-filegroup {
- name: "perfetto_src_trace_processor_protozero_to_text",
- srcs: [
- "src/trace_processor/util/protozero_to_text.cc",
- ],
-}
-
// GN: //src/trace_processor/sqlite:sqlite
filegroup {
name: "perfetto_src_trace_processor_sqlite_sqlite",
@@ -6673,10 +6657,38 @@
"src/trace_processor/importers/syscalls/syscall_tracker_unittest.cc",
"src/trace_processor/importers/systrace/systrace_parser_unittest.cc",
"src/trace_processor/trace_sorter_unittest.cc",
+ ],
+}
+
+// GN: //src/trace_processor/util:descriptors
+filegroup {
+ name: "perfetto_src_trace_processor_util_descriptors",
+ srcs: [
+ "src/trace_processor/util/descriptors.cc",
+ ],
+}
+
+// GN: //src/trace_processor/util:protozero_to_text
+filegroup {
+ name: "perfetto_src_trace_processor_util_protozero_to_text",
+ srcs: [
+ "src/trace_processor/util/protozero_to_text.cc",
+ ],
+}
+
+// GN: //src/trace_processor/util:unittests
+filegroup {
+ name: "perfetto_src_trace_processor_util_unittests",
+ srcs: [
"src/trace_processor/util/protozero_to_text_unittests.cc",
],
}
+// GN: //src/trace_processor/util:util
+filegroup {
+ name: "perfetto_src_trace_processor_util_util",
+}
+
// GN: //src/traced/probes/android_log:android_log
filegroup {
name: "perfetto_src_traced_probes_android_log_android_log",
@@ -7541,13 +7553,11 @@
":perfetto_src_trace_processor_containers_unittests",
":perfetto_src_trace_processor_db_lib",
":perfetto_src_trace_processor_db_unittests",
- ":perfetto_src_trace_processor_descriptors",
":perfetto_src_trace_processor_export_json",
":perfetto_src_trace_processor_ftrace_descriptors",
":perfetto_src_trace_processor_lib",
":perfetto_src_trace_processor_metrics_lib",
":perfetto_src_trace_processor_metrics_unittests",
- ":perfetto_src_trace_processor_protozero_to_text",
":perfetto_src_trace_processor_sqlite_sqlite",
":perfetto_src_trace_processor_sqlite_unittests",
":perfetto_src_trace_processor_storage_full",
@@ -7559,6 +7569,10 @@
":perfetto_src_trace_processor_types_types",
":perfetto_src_trace_processor_types_unittests",
":perfetto_src_trace_processor_unittests",
+ ":perfetto_src_trace_processor_util_descriptors",
+ ":perfetto_src_trace_processor_util_protozero_to_text",
+ ":perfetto_src_trace_processor_util_unittests",
+ ":perfetto_src_trace_processor_util_util",
":perfetto_src_traced_probes_android_log_android_log",
":perfetto_src_traced_probes_android_log_unittests",
":perfetto_src_traced_probes_common_common",
@@ -7790,7 +7804,6 @@
":perfetto_src_trace_processor_analysis_analysis",
":perfetto_src_trace_processor_containers_containers",
":perfetto_src_trace_processor_db_lib",
- ":perfetto_src_trace_processor_descriptors",
":perfetto_src_trace_processor_export_json",
":perfetto_src_trace_processor_ftrace_descriptors",
":perfetto_src_trace_processor_lib",
@@ -7802,6 +7815,8 @@
":perfetto_src_trace_processor_tables_tables",
":perfetto_src_trace_processor_track_event_descriptor",
":perfetto_src_trace_processor_types_types",
+ ":perfetto_src_trace_processor_util_descriptors",
+ ":perfetto_src_trace_processor_util_util",
"src/trace_processor/trace_processor_shell.cc",
"src/trace_processor/util/proto_to_json.cc",
],
@@ -7905,7 +7920,6 @@
":perfetto_src_trace_processor_analysis_analysis",
":perfetto_src_trace_processor_containers_containers",
":perfetto_src_trace_processor_db_lib",
- ":perfetto_src_trace_processor_descriptors",
":perfetto_src_trace_processor_export_json",
":perfetto_src_trace_processor_ftrace_descriptors",
":perfetto_src_trace_processor_lib",
@@ -7917,6 +7931,8 @@
":perfetto_src_trace_processor_tables_tables",
":perfetto_src_trace_processor_track_event_descriptor",
":perfetto_src_trace_processor_types_types",
+ ":perfetto_src_trace_processor_util_descriptors",
+ ":perfetto_src_trace_processor_util_util",
":perfetto_tools_trace_to_text_common",
":perfetto_tools_trace_to_text_full",
":perfetto_tools_trace_to_text_pprofbuilder",
diff --git a/BUILD b/BUILD
index ee89ee2..5080adb 100644
--- a/BUILD
+++ b/BUILD
@@ -855,15 +855,23 @@
],
)
-# GN target: //src/trace_processor:descriptors
+# GN target: //src/trace_processor/util:descriptors
filegroup(
- name = "src_trace_processor_descriptors",
+ name = "src_trace_processor_util_descriptors",
srcs = [
"src/trace_processor/util/descriptors.cc",
"src/trace_processor/util/descriptors.h",
],
)
+# GN target: //src/trace_processor/util:util
+filegroup(
+ name = "src_trace_processor_util_util",
+ srcs = [
+ "src/trace_processor/util/status_macros.h",
+ ],
+)
+
# GN target: //src/trace_processor:export_json
filegroup(
name = "src_trace_processor_export_json",
@@ -1043,7 +1051,6 @@
"src/trace_processor/trace_processor_storage_impl.h",
"src/trace_processor/trace_sorter.cc",
"src/trace_processor/trace_sorter.h",
- "src/trace_processor/util/status_macros.h",
"src/trace_processor/virtual_destructors.cc",
],
)
@@ -2816,7 +2823,6 @@
":src_trace_processor_analysis_analysis",
":src_trace_processor_containers_containers",
":src_trace_processor_db_lib",
- ":src_trace_processor_descriptors",
":src_trace_processor_export_json",
":src_trace_processor_ftrace_descriptors",
":src_trace_processor_lib",
@@ -2828,6 +2834,8 @@
":src_trace_processor_tables_tables",
":src_trace_processor_track_event_descriptor",
":src_trace_processor_types_types",
+ ":src_trace_processor_util_descriptors",
+ ":src_trace_processor_util_util",
],
hdrs = [
":include_perfetto_base_base",
@@ -2904,7 +2912,6 @@
":src_trace_processor_analysis_analysis",
":src_trace_processor_containers_containers",
":src_trace_processor_db_lib",
- ":src_trace_processor_descriptors",
":src_trace_processor_export_json",
":src_trace_processor_ftrace_descriptors",
":src_trace_processor_lib",
@@ -2918,6 +2925,8 @@
":src_trace_processor_tables_tables",
":src_trace_processor_track_event_descriptor",
":src_trace_processor_types_types",
+ ":src_trace_processor_util_descriptors",
+ ":src_trace_processor_util_util",
],
visibility = [
"//visibility:public",
@@ -3070,7 +3079,6 @@
":src_trace_processor_analysis_analysis",
":src_trace_processor_containers_containers",
":src_trace_processor_db_lib",
- ":src_trace_processor_descriptors",
":src_trace_processor_export_json",
":src_trace_processor_ftrace_descriptors",
":src_trace_processor_lib",
@@ -3082,6 +3090,8 @@
":src_trace_processor_tables_tables",
":src_trace_processor_track_event_descriptor",
":src_trace_processor_types_types",
+ ":src_trace_processor_util_descriptors",
+ ":src_trace_processor_util_util",
":tools_trace_to_text_common",
":tools_trace_to_text_full",
":tools_trace_to_text_pprofbuilder",
diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn
index 7ee502d..1bbf36a 100644
--- a/src/trace_processor/BUILD.gn
+++ b/src/trace_processor/BUILD.gn
@@ -58,36 +58,6 @@
]
}
-source_set("protozero_to_text") {
- sources = [
- "util/protozero_to_text.cc",
- "util/protozero_to_text.h",
- ]
- deps = [
- ":descriptors",
- ":track_event_descriptor",
- "../../gn:default_deps",
- "../../protos/perfetto/common:zero",
- "../../protos/perfetto/trace/track_event:zero",
- "../base",
- "../protozero",
- ]
-}
-
-source_set("descriptors") {
- sources = [
- "util/descriptors.cc",
- "util/descriptors.h",
- ]
- deps = [
- "../../gn:default_deps",
- "../../include/perfetto/trace_processor",
- "../../protos/perfetto/common:zero",
- "../base",
- "../protozero",
- ]
-}
-
source_set("storage_minimal") {
sources = [
"chunked_trace_reader.h",
@@ -159,11 +129,9 @@
"trace_processor_storage_impl.h",
"trace_sorter.cc",
"trace_sorter.h",
- "util/status_macros.h",
"virtual_destructors.cc",
]
deps = [
- ":descriptors",
":track_event_descriptor",
"../../gn:default_deps",
"../base",
@@ -172,6 +140,8 @@
"storage",
"tables",
"types",
+ "util",
+ "util:descriptors",
]
public_deps = [
"../../include/perfetto/trace_processor:storage",
@@ -387,11 +357,8 @@
"importers/syscalls/syscall_tracker_unittest.cc",
"importers/systrace/systrace_parser_unittest.cc",
"trace_sorter_unittest.cc",
- "util/protozero_to_text_unittests.cc",
]
deps = [
- ":descriptors",
- ":protozero_to_text",
":storage_full",
"../../gn:default_deps",
"../../gn:gtest_and_gmock",
@@ -416,6 +383,7 @@
"tables:unittests",
"types",
"types:unittests",
+ "util:unittests",
]
if (enable_perfetto_trace_processor_sqlite) {
diff --git a/src/trace_processor/metrics/BUILD.gn b/src/trace_processor/metrics/BUILD.gn
index 3357d9b..4ee3098 100644
--- a/src/trace_processor/metrics/BUILD.gn
+++ b/src/trace_processor/metrics/BUILD.gn
@@ -85,7 +85,7 @@
]
public_deps = [
":gen_merged_sql_metrics",
- "../../trace_processor:descriptors",
+ "../util:descriptors",
]
}
diff --git a/src/trace_processor/util/BUILD.gn b/src/trace_processor/util/BUILD.gn
new file mode 100644
index 0000000..28f1781
--- /dev/null
+++ b/src/trace_processor/util/BUILD.gn
@@ -0,0 +1,67 @@
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("../../../gn/perfetto.gni")
+
+source_set("util") {
+ sources = [ "status_macros.h" ]
+ deps = [
+ "../../../gn:default_deps",
+ "../../../include/perfetto/trace_processor:basic_types",
+ ]
+}
+
+source_set("protozero_to_text") {
+ sources = [
+ "protozero_to_text.cc",
+ "protozero_to_text.h",
+ ]
+ deps = [
+ ":descriptors",
+ "..:track_event_descriptor",
+ "../../../gn:default_deps",
+ "../../../protos/perfetto/common:zero",
+ "../../../protos/perfetto/trace/track_event:zero",
+ "../../base",
+ "../../protozero",
+ ]
+}
+
+source_set("descriptors") {
+ sources = [
+ "descriptors.cc",
+ "descriptors.h",
+ ]
+ deps = [
+ "..:track_event_descriptor",
+ "../../../gn:default_deps",
+ "../../../include/perfetto/trace_processor",
+ "../../../protos/perfetto/common:zero",
+ "../../base",
+ "../../protozero",
+ ]
+}
+
+source_set("unittests") {
+ sources = [ "protozero_to_text_unittests.cc" ]
+ testonly = true
+ deps = [
+ ":protozero_to_text",
+ "..:track_event_descriptor",
+ "../../../gn:default_deps",
+ "../../../gn:gtest_and_gmock",
+ "../../../protos/perfetto/trace/track_event:zero",
+ "../../protozero",
+ ]
+}