tp: move descriptor pool, proto conv and status macros -> util
Change-Id: I79a16169219a9bcc07f8c0b00d5baef959a914c0
diff --git a/Android.bp b/Android.bp
index 389672c..965e404 100644
--- a/Android.bp
+++ b/Android.bp
@@ -6445,7 +6445,7 @@
filegroup {
name: "perfetto_src_trace_processor_descriptors",
srcs: [
- "src/trace_processor/descriptors.cc",
+ "src/trace_processor/util/descriptors.cc",
],
}
@@ -6498,7 +6498,7 @@
filegroup {
name: "perfetto_src_trace_processor_protozero_to_text",
srcs: [
- "src/trace_processor/protozero_to_text.cc",
+ "src/trace_processor/util/protozero_to_text.cc",
],
}
@@ -6672,8 +6672,8 @@
"src/trace_processor/importers/proto/proto_trace_parser_unittest.cc",
"src/trace_processor/importers/syscalls/syscall_tracker_unittest.cc",
"src/trace_processor/importers/systrace/systrace_parser_unittest.cc",
- "src/trace_processor/protozero_to_text_unittests.cc",
"src/trace_processor/trace_sorter_unittest.cc",
+ "src/trace_processor/util/protozero_to_text_unittests.cc",
],
}
@@ -7802,8 +7802,8 @@
":perfetto_src_trace_processor_tables_tables",
":perfetto_src_trace_processor_track_event_descriptor",
":perfetto_src_trace_processor_types_types",
- "src/trace_processor/proto_to_json.cc",
"src/trace_processor/trace_processor_shell.cc",
+ "src/trace_processor/util/proto_to_json.cc",
],
static_libs: [
"libprotoc",
diff --git a/BUILD b/BUILD
index 214bef3..ee89ee2 100644
--- a/BUILD
+++ b/BUILD
@@ -859,8 +859,8 @@
filegroup(
name = "src_trace_processor_descriptors",
srcs = [
- "src/trace_processor/descriptors.cc",
- "src/trace_processor/descriptors.h",
+ "src/trace_processor/util/descriptors.cc",
+ "src/trace_processor/util/descriptors.h",
],
)
@@ -1034,7 +1034,6 @@
"src/trace_processor/importers/proto/track_event_tokenizer.h",
"src/trace_processor/importers/syscalls/syscall_tracker.h",
"src/trace_processor/importers/systrace/systrace_line.h",
- "src/trace_processor/status_macros.h",
"src/trace_processor/timestamped_trace_piece.h",
"src/trace_processor/trace_blob_view.h",
"src/trace_processor/trace_parser.h",
@@ -1044,6 +1043,7 @@
"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",
],
)
@@ -2885,9 +2885,9 @@
perfetto_cc_binary(
name = "trace_processor_shell",
srcs = [
- "src/trace_processor/proto_to_json.cc",
- "src/trace_processor/proto_to_json.h",
"src/trace_processor/trace_processor_shell.cc",
+ "src/trace_processor/util/proto_to_json.cc",
+ "src/trace_processor/util/proto_to_json.h",
":include_perfetto_base_base",
":include_perfetto_ext_base_base",
":include_perfetto_ext_trace_processor_export_json",
diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn
index e194d81..7ee502d 100644
--- a/src/trace_processor/BUILD.gn
+++ b/src/trace_processor/BUILD.gn
@@ -60,8 +60,8 @@
source_set("protozero_to_text") {
sources = [
- "protozero_to_text.cc",
- "protozero_to_text.h",
+ "util/protozero_to_text.cc",
+ "util/protozero_to_text.h",
]
deps = [
":descriptors",
@@ -76,8 +76,8 @@
source_set("descriptors") {
sources = [
- "descriptors.cc",
- "descriptors.h",
+ "util/descriptors.cc",
+ "util/descriptors.h",
]
deps = [
"../../gn:default_deps",
@@ -150,7 +150,6 @@
"importers/proto/track_event_tokenizer.h",
"importers/syscalls/syscall_tracker.h",
"importers/systrace/systrace_line.h",
- "status_macros.h",
"timestamped_trace_piece.h",
"trace_blob_view.h",
"trace_parser.h",
@@ -160,6 +159,7 @@
"trace_processor_storage_impl.h",
"trace_sorter.cc",
"trace_sorter.h",
+ "util/status_macros.h",
"virtual_destructors.cc",
]
deps = [
@@ -363,9 +363,9 @@
deps += [ "rpc:httpd" ]
}
sources = [
- "proto_to_json.cc",
- "proto_to_json.h",
"trace_processor_shell.cc",
+ "util/proto_to_json.cc",
+ "util/proto_to_json.h",
]
}
} # if (enable_perfetto_trace_processor_sqlite)
@@ -386,8 +386,8 @@
"importers/proto/proto_trace_parser_unittest.cc",
"importers/syscalls/syscall_tracker_unittest.cc",
"importers/systrace/systrace_parser_unittest.cc",
- "protozero_to_text_unittests.cc",
"trace_sorter_unittest.cc",
+ "util/protozero_to_text_unittests.cc",
]
deps = [
":descriptors",
diff --git a/src/trace_processor/importers/proto/args_table_utils.h b/src/trace_processor/importers/proto/args_table_utils.h
index 1b2b318..05f158c 100644
--- a/src/trace_processor/importers/proto/args_table_utils.h
+++ b/src/trace_processor/importers/proto/args_table_utils.h
@@ -19,10 +19,10 @@
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/trace_processor/status.h"
-#include "src/trace_processor/descriptors.h"
#include "src/trace_processor/importers/common/args_tracker.h"
#include "src/trace_processor/importers/proto/packet_sequence_state.h"
#include "src/trace_processor/storage/trace_storage.h"
+#include "src/trace_processor/util/descriptors.h"
namespace perfetto {
namespace trace_processor {
diff --git a/src/trace_processor/importers/proto/track_event_parser.cc b/src/trace_processor/importers/proto/track_event_parser.cc
index a96d839..d928a00 100644
--- a/src/trace_processor/importers/proto/track_event_parser.cc
+++ b/src/trace_processor/importers/proto/track_event_parser.cc
@@ -29,7 +29,7 @@
#include "src/trace_processor/importers/proto/args_table_utils.h"
#include "src/trace_processor/importers/proto/packet_sequence_state.h"
#include "src/trace_processor/importers/proto/track_event.descriptor.h"
-#include "src/trace_processor/status_macros.h"
+#include "src/trace_processor/util/status_macros.h"
#include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
#include "protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.pbzero.h"
diff --git a/src/trace_processor/metrics/metrics.h b/src/trace_processor/metrics/metrics.h
index 589413b..8568c15 100644
--- a/src/trace_processor/metrics/metrics.h
+++ b/src/trace_processor/metrics/metrics.h
@@ -27,7 +27,7 @@
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
#include "perfetto/trace_processor/trace_processor.h"
-#include "src/trace_processor/descriptors.h"
+#include "src/trace_processor/util/descriptors.h"
#include "protos/perfetto/trace_processor/metrics_impl.pbzero.h"
diff --git a/src/trace_processor/trace_processor_impl.h b/src/trace_processor/trace_processor_impl.h
index 6d0967d..56dbdae 100644
--- a/src/trace_processor/trace_processor_impl.h
+++ b/src/trace_processor/trace_processor_impl.h
@@ -33,8 +33,8 @@
#include "src/trace_processor/sqlite/scoped_db.h"
#include "src/trace_processor/trace_processor_storage_impl.h"
-#include "src/trace_processor/descriptors.h"
#include "src/trace_processor/metrics/metrics.h"
+#include "src/trace_processor/util/descriptors.h"
namespace perfetto {
namespace trace_processor {
diff --git a/src/trace_processor/trace_processor_shell.cc b/src/trace_processor/trace_processor_shell.cc
index 22bd5d8..f248937 100644
--- a/src/trace_processor/trace_processor_shell.cc
+++ b/src/trace_processor/trace_processor_shell.cc
@@ -39,7 +39,7 @@
#include "perfetto/trace_processor/trace_processor.h"
#include "src/trace_processor/metrics/custom_options.descriptor.h"
#include "src/trace_processor/metrics/metrics.descriptor.h"
-#include "src/trace_processor/proto_to_json.h"
+#include "src/trace_processor/util/proto_to_json.h"
#if PERFETTO_BUILDFLAG(PERFETTO_TP_HTTPD)
#include "src/trace_processor/rpc/httpd.h"
diff --git a/src/trace_processor/descriptors.cc b/src/trace_processor/util/descriptors.cc
similarity index 99%
rename from src/trace_processor/descriptors.cc
rename to src/trace_processor/util/descriptors.cc
index 7e04d32..c92488e 100644
--- a/src/trace_processor/descriptors.cc
+++ b/src/trace_processor/util/descriptors.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "src/trace_processor/descriptors.h"
+#include "src/trace_processor/util/descriptors.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/protozero/field.h"
diff --git a/src/trace_processor/descriptors.h b/src/trace_processor/util/descriptors.h
similarity index 97%
rename from src/trace_processor/descriptors.h
rename to src/trace_processor/util/descriptors.h
index 7dd6ded..59ea48d 100644
--- a/src/trace_processor/descriptors.h
+++ b/src/trace_processor/util/descriptors.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SRC_TRACE_PROCESSOR_DESCRIPTORS_H_
-#define SRC_TRACE_PROCESSOR_DESCRIPTORS_H_
+#ifndef SRC_TRACE_PROCESSOR_UTIL_DESCRIPTORS_H_
+#define SRC_TRACE_PROCESSOR_UTIL_DESCRIPTORS_H_
#include <algorithm>
#include <string>
@@ -162,4 +162,4 @@
} // namespace trace_processor
} // namespace perfetto
-#endif // SRC_TRACE_PROCESSOR_DESCRIPTORS_H_
+#endif // SRC_TRACE_PROCESSOR_UTIL_DESCRIPTORS_H_
diff --git a/src/trace_processor/proto_to_json.cc b/src/trace_processor/util/proto_to_json.cc
similarity index 99%
rename from src/trace_processor/proto_to_json.cc
rename to src/trace_processor/util/proto_to_json.cc
index e6f22e9..6befd5e 100644
--- a/src/trace_processor/proto_to_json.cc
+++ b/src/trace_processor/util/proto_to_json.cc
@@ -22,7 +22,7 @@
#include "perfetto/base/logging.h"
#include "perfetto/ext/base/string_utils.h"
-#include "src/trace_processor/proto_to_json.h"
+#include "src/trace_processor/util/proto_to_json.h"
namespace perfetto {
namespace trace_processor {
diff --git a/src/trace_processor/proto_to_json.h b/src/trace_processor/util/proto_to_json.h
similarity index 87%
rename from src/trace_processor/proto_to_json.h
rename to src/trace_processor/util/proto_to_json.h
index 90cae5c..cfe7a11 100644
--- a/src/trace_processor/proto_to_json.h
+++ b/src/trace_processor/util/proto_to_json.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SRC_TRACE_PROCESSOR_PROTO_TO_JSON_H_
-#define SRC_TRACE_PROCESSOR_PROTO_TO_JSON_H_
+#ifndef SRC_TRACE_PROCESSOR_UTIL_PROTO_TO_JSON_H_
+#define SRC_TRACE_PROCESSOR_UTIL_PROTO_TO_JSON_H_
#include <google/protobuf/message.h>
@@ -35,4 +35,4 @@
} // namespace trace_processor
} // namespace perfetto
-#endif // SRC_TRACE_PROCESSOR_PROTO_TO_JSON_H_
+#endif // SRC_TRACE_PROCESSOR_UTIL_PROTO_TO_JSON_H_
diff --git a/src/trace_processor/protozero_to_text.cc b/src/trace_processor/util/protozero_to_text.cc
similarity index 98%
rename from src/trace_processor/protozero_to_text.cc
rename to src/trace_processor/util/protozero_to_text.cc
index c33abf8..cc0f659 100644
--- a/src/trace_processor/protozero_to_text.cc
+++ b/src/trace_processor/util/protozero_to_text.cc
@@ -1,10 +1,10 @@
-#include "src/trace_processor/protozero_to_text.h"
+#include "src/trace_processor/util/protozero_to_text.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"
#include "protos/perfetto/common/descriptor.pbzero.h"
-#include "src/trace_processor/descriptors.h"
+#include "src/trace_processor/util/descriptors.h"
// This is the highest level that this protozero to text supports.
#include "src/trace_processor/importers/proto/track_event.descriptor.h"
diff --git a/src/trace_processor/protozero_to_text.h b/src/trace_processor/util/protozero_to_text.h
similarity index 91%
rename from src/trace_processor/protozero_to_text.h
rename to src/trace_processor/util/protozero_to_text.h
index 054434a..e418926 100644
--- a/src/trace_processor/protozero_to_text.h
+++ b/src/trace_processor/util/protozero_to_text.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SRC_TRACE_PROCESSOR_PROTOZERO_TO_TEXT_H_
-#define SRC_TRACE_PROCESSOR_PROTOZERO_TO_TEXT_H_
+#ifndef SRC_TRACE_PROCESSOR_UTIL_PROTOZERO_TO_TEXT_H_
+#define SRC_TRACE_PROCESSOR_UTIL_PROTOZERO_TO_TEXT_H_
#include <string>
@@ -46,4 +46,4 @@
} // namespace trace_processor
} // namespace perfetto
-#endif // SRC_TRACE_PROCESSOR_PROTOZERO_TO_TEXT_H_
+#endif // SRC_TRACE_PROCESSOR_UTIL_PROTOZERO_TO_TEXT_H_
diff --git a/src/trace_processor/protozero_to_text_unittests.cc b/src/trace_processor/util/protozero_to_text_unittests.cc
similarity index 98%
rename from src/trace_processor/protozero_to_text_unittests.cc
rename to src/trace_processor/util/protozero_to_text_unittests.cc
index fe795ed..e172dd6 100644
--- a/src/trace_processor/protozero_to_text_unittests.cc
+++ b/src/trace_processor/util/protozero_to_text_unittests.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "src/trace_processor/protozero_to_text.h"
+#include "src/trace_processor/util/protozero_to_text.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
#include "protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.pbzero.h"
diff --git a/src/trace_processor/status_macros.h b/src/trace_processor/util/status_macros.h
similarity index 87%
rename from src/trace_processor/status_macros.h
rename to src/trace_processor/util/status_macros.h
index b54e68f..50e2bb4 100644
--- a/src/trace_processor/status_macros.h
+++ b/src/trace_processor/util/status_macros.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SRC_TRACE_PROCESSOR_STATUS_MACROS_H_
-#define SRC_TRACE_PROCESSOR_STATUS_MACROS_H_
+#ifndef SRC_TRACE_PROCESSOR_UTIL_STATUS_MACROS_H_
+#define SRC_TRACE_PROCESSOR_UTIL_STATUS_MACROS_H_
#include "perfetto/trace_processor/status.h"
@@ -28,4 +28,4 @@
return status_macro_internal_status; \
} while (0)
-#endif // SRC_TRACE_PROCESSOR_STATUS_MACROS_H_
+#endif // SRC_TRACE_PROCESSOR_UTIL_STATUS_MACROS_H_