Commit 2f2e0dd4 authored by Primiano Tucci's avatar Primiano Tucci Committed by Commit Bot

Roll Perfetto from 72e31331da03 to ef0fb4c2707e (5 revisions)

This is a manual roll to catch up with the changes in http://r.android.com/1393348

https://android.googlesource.com/platform/external/perfetto.git/+log/72e31331da03..ef0fb4c2707e

2020-08-19 lalitm@google.com Merge "tp: use sched blocked reason in thread state table"
2020-08-19 fmayer@google.com Fix non-explicit single-argument ctors.
2020-08-19 lalitm@google.com Merge "tp: parse sched blocked reason from proto and systrace"
2020-08-19 primiano@google.com Merge "Protozero: fall back on the heap when nesting too deep"
2020-08-19 taylori@google.com Update trace_processor

Bug: 960303
Change-Id: I62ba6535aa56c1b90cbe9b3a3e6597e9a59e949f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362805
Commit-Queue: Primiano Tucci <primiano@chromium.org>
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Auto-Submit: Primiano Tucci <primiano@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799760}
parent eb882fc3
......@@ -1248,7 +1248,7 @@ deps = {
},
'src/third_party/perfetto':
Var('android_git') + '/platform/external/perfetto.git' + '@' + '72e31331da037f1e410c183484d086b71257a80e',
Var('android_git') + '/platform/external/perfetto.git' + '@' + 'ef0fb4c2707e07b2cdff4186893bceea3ab1153c',
'src/third_party/perl': {
'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3',
......
......@@ -13,6 +13,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/perfetto/include/perfetto/ext/base/utils.h"
#include "third_party/perfetto/include/perfetto/ext/tracing/core/trace_writer.h"
#include "third_party/perfetto/include/perfetto/protozero/root_message.h"
namespace tracing {
......@@ -41,7 +42,7 @@ class DummyTraceWriter : public perfetto::TraceWriter {
uint64_t written() const override { return 0u; }
private:
perfetto::protos::pbzero::TracePacket trace_packet_;
protozero::RootMessage<perfetto::protos::pbzero::TracePacket> trace_packet_;
protozero::ScatteredStreamWriterNullDelegate delegate_;
protozero::ScatteredStreamWriter stream_;
};
......
......@@ -13,6 +13,7 @@
#include "services/tracing/public/cpp/perfetto/producer_client.h"
#include "services/tracing/public/cpp/perfetto/task_runner.h"
#include "third_party/perfetto/include/perfetto/ext/tracing/core/trace_writer.h"
#include "third_party/perfetto/include/perfetto/protozero/root_message.h"
#include "third_party/perfetto/include/perfetto/protozero/scattered_stream_null_delegate.h"
#include "third_party/perfetto/protos/perfetto/trace/chrome/chrome_trace_event.pb.h"
#include "third_party/perfetto/protos/perfetto/trace/trace_packet.pb.h"
......@@ -64,7 +65,7 @@ class TestProducerClient : public ProducerClient {
legacy_metadata_packets_;
std::vector<std::unique_ptr<perfetto::protos::TracePacket>>
proto_metadata_packets_;
perfetto::protos::pbzero::TracePacket trace_packet_;
protozero::RootMessage<perfetto::protos::pbzero::TracePacket> trace_packet_;
protozero::ScatteredStreamWriterNullDelegate delegate_;
protozero::ScatteredStreamWriter stream_;
std::unique_ptr<PerfettoTaskRunner> main_thread_task_runner_;
......
......@@ -11,6 +11,7 @@
#include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h"
#include "third_party/perfetto/include/perfetto/protozero/message_handle.h"
#include "third_party/perfetto/include/perfetto/protozero/root_message.h"
#include "third_party/perfetto/include/perfetto/protozero/scattered_heap_buffer.h"
#include "third_party/perfetto/include/perfetto/protozero/scattered_stream_writer.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
......@@ -241,7 +242,7 @@ class ProtoWriter final : public TracedValue::Writer {
std::stack<ProtoValueHandle> node_stack_;
ProtoValue proto_;
protozero::RootMessage<ProtoValue> proto_;
protozero::ScatteredHeapBuffer buffer_;
protozero::ScatteredStreamWriter stream_;
};
......
......@@ -107,19 +107,12 @@ bool IsValue(const NestedValue* proto_value, const char* value) {
}
NestedValue GetProtoFromTracedValue(TracedValue* traced_value) {
protozero::ScatteredHeapBuffer buffer(100);
protozero::ScatteredStreamWriter stream(&buffer);
perfetto::protos::pbzero::DebugAnnotation proto;
proto.Reset(&stream);
buffer.set_writer(&stream);
PerfettoProtoAppender proto_appender(&proto);
protozero::HeapBuffered<perfetto::protos::pbzero::DebugAnnotation> proto;
PerfettoProtoAppender proto_appender(proto.get());
EXPECT_TRUE(traced_value->AppendToProto(&proto_appender));
uint32_t size = proto.Finalize();
ProtoInputStream proto_stream(&buffer);
DebugAnnotation full_proto;
EXPECT_TRUE(full_proto.ParseFromBoundedZeroCopyStream(&proto_stream, size));
EXPECT_TRUE(full_proto.ParseFromString(proto.SerializeAsString()));
EXPECT_TRUE(full_proto.has_nested_value());
return full_proto.nested_value();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment