TraceProcesor: unique_ptr<uint8_t> -> TraceBlob
A non-functional refactoring to TraceProcessor.
This CL mainly replaces all the places where we pass around
a pair of (unique_ptr<uint8_t>, size_t) with an explicit
TraceBlob.
It also simplifies a bit the TraceBlobView code, reducing
the indirection layers required to handle refcounting
(the overall refcounting principle still holds though).
The main benefit of that is removing one layer of pointer
chasing when accessing TraceBlobView.data().
The main reason of this CL is to introduce support for mmaping
the trace file on desktop (but still retain the owned-buf
semantic for wasm and platforms where mmap is not supported).
Bug: 205302474
Change-Id: I4f943bfcf0032cda910277b6d47851c73cb16316
diff --git a/BUILD b/BUILD
index 6422ad6..6d764f6 100644
--- a/BUILD
+++ b/BUILD
@@ -515,6 +515,8 @@
perfetto_filegroup(
name = "include_perfetto_trace_processor_storage",
srcs = [
+ "include/perfetto/trace_processor/trace_blob.h",
+ "include/perfetto/trace_processor/trace_blob_view.h",
"include/perfetto/trace_processor/trace_processor_storage.h",
],
)
@@ -1268,14 +1270,6 @@
],
)
-# GN target: //src/trace_processor/util:trace_blob_view
-perfetto_filegroup(
- name = "src_trace_processor_util_trace_blob_view",
- srcs = [
- "src/trace_processor/util/trace_blob_view.h",
- ],
-)
-
# GN target: //src/trace_processor/util:util
perfetto_filegroup(
name = "src_trace_processor_util_util",
@@ -1487,6 +1481,7 @@
"src/trace_processor/importers/syscalls/syscall_tracker.h",
"src/trace_processor/importers/systrace/systrace_line.h",
"src/trace_processor/timestamped_trace_piece.h",
+ "src/trace_processor/trace_blob.cc",
"src/trace_processor/trace_processor_context.cc",
"src/trace_processor/trace_processor_storage.cc",
"src/trace_processor/trace_processor_storage_impl.cc",
@@ -3697,7 +3692,6 @@
":src_trace_processor_util_interned_message_view",
":src_trace_processor_util_proto_to_args_parser",
":src_trace_processor_util_protozero_to_text",
- ":src_trace_processor_util_trace_blob_view",
":src_trace_processor_util_util",
],
hdrs = [
@@ -3799,7 +3793,6 @@
":src_trace_processor_util_interned_message_view",
":src_trace_processor_util_proto_to_args_parser",
":src_trace_processor_util_protozero_to_text",
- ":src_trace_processor_util_trace_blob_view",
":src_trace_processor_util_util",
"src/trace_processor/trace_processor_shell.cc",
"src/trace_processor/util/proto_to_json.cc",
@@ -3982,7 +3975,6 @@
":src_trace_processor_util_interned_message_view",
":src_trace_processor_util_proto_to_args_parser",
":src_trace_processor_util_protozero_to_text",
- ":src_trace_processor_util_trace_blob_view",
":src_trace_processor_util_util",
":tools_trace_to_text_common",
":tools_trace_to_text_full",