diff --git a/services/surfaceflinger/tests/Stress_test.cpp b/services/surfaceflinger/tests/Stress_test.cpp
index 03201f7..b30df5e 100644
--- a/services/surfaceflinger/tests/Stress_test.cpp
+++ b/services/surfaceflinger/tests/Stress_test.cpp
@@ -51,9 +51,9 @@
     }
 }
 
-surfaceflinger::LayersProto generateLayerProto() {
-    surfaceflinger::LayersProto layersProto;
-    std::array<surfaceflinger::LayerProto*, 10> layers = {};
+perfetto::protos::LayersProto generateLayerProto() {
+    perfetto::protos::LayersProto layersProto;
+    std::array<perfetto::protos::LayerProto*, 10> layers = {};
     for (size_t i = 0; i < layers.size(); ++i) {
         layers[i] = layersProto.add_layers();
         layers[i]->set_id(i);
@@ -103,7 +103,7 @@
     cmd += std::to_string(getpid());
     system(cmd.c_str());
     for (int i = 0; i < 100000; i++) {
-        surfaceflinger::LayersProto layersProto = generateLayerProto();
+        perfetto::protos::LayersProto layersProto = generateLayerProto();
         auto layerTree = surfaceflinger::LayerProtoParser::generateLayerTree(layersProto);
         surfaceflinger::LayerProtoParser::layerTreeToString(layerTree);
     }
diff --git a/services/surfaceflinger/tests/tracing/TransactionTraceTestSuite.cpp b/services/surfaceflinger/tests/tracing/TransactionTraceTestSuite.cpp
index b8a5e79..333768a 100644
--- a/services/surfaceflinger/tests/tracing/TransactionTraceTestSuite.cpp
+++ b/services/surfaceflinger/tests/tracing/TransactionTraceTestSuite.cpp
@@ -149,7 +149,7 @@
 }
 
 static std::vector<LayerInfo> getLayerInfosFromProto(
-        android::surfaceflinger::LayersTraceProto& entry) {
+        perfetto::protos::pbzero::LayersSnapshotProto& entry) {
     std::unordered_map<uint64_t /* snapshotId*/, uint64_t /*layerId*/> snapshotIdToLayerId;
     std::vector<LayerInfo> layers;
     layers.reserve(static_cast<size_t>(entry.layers().layers_size()));
@@ -267,4 +267,4 @@
     }
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp b/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
index a95a645..cbb597a 100644
--- a/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
+++ b/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
@@ -85,7 +85,7 @@
 
     TransactionProtoParser parser(std::make_unique<TestMapper>(displayHandle));
 
-    proto::TransactionState proto = parser.toProto(t1);
+    perfetto::protos::TransactionState proto = parser.toProto(t1);
     TransactionState t2 = parser.fromProto(proto);
 
     ASSERT_EQ(t1.originPid, t2.originPid);
@@ -119,7 +119,7 @@
     d1.transformHint = ui::Transform::ROT_90;
 
     const uint32_t layerStack = 2;
-    google::protobuf::RepeatedPtrField<proto::DisplayInfo> displayProtos;
+    google::protobuf::RepeatedPtrField<perfetto::protos::DisplayInfo> displayProtos;
     auto displayInfoProto = displayProtos.Add();
     *displayInfoProto = TransactionProtoParser::toProto(d1, layerStack);
     frontend::DisplayInfos displayInfos;
diff --git a/services/surfaceflinger/tests/unittests/TransactionTracingTest.cpp b/services/surfaceflinger/tests/unittests/TransactionTracingTest.cpp
index 71a2d2b..7981224 100644
--- a/services/surfaceflinger/tests/unittests/TransactionTracingTest.cpp
+++ b/services/surfaceflinger/tests/unittests/TransactionTracingTest.cpp
@@ -37,11 +37,11 @@
     TransactionTracing mTracing;
 
     void flush() { mTracing.flush(); }
-    proto::TransactionTraceFile writeToProto() { return mTracing.writeToProto(); }
+    perfetto::protos::TransactionTraceFile writeToProto() { return mTracing.writeToProto(); }
 
-    proto::TransactionTraceEntry bufferFront() {
+    perfetto::protos::TransactionTraceEntry bufferFront() {
         std::scoped_lock<std::mutex> lock(mTracing.mTraceLock);
-        proto::TransactionTraceEntry entry;
+        perfetto::protos::TransactionTraceEntry entry;
         entry.ParseFromString(mTracing.mBuffer.front());
         return entry;
     }
@@ -59,7 +59,7 @@
         flush();
     }
 
-    void verifyEntry(const proto::TransactionTraceEntry& actualProto,
+    void verifyEntry(const perfetto::protos::TransactionTraceEntry& actualProto,
                      const std::vector<TransactionState>& expectedTransactions,
                      int64_t expectedVsyncId) {
         EXPECT_EQ(actualProto.vsync_id(), expectedVsyncId);
@@ -117,7 +117,7 @@
     mTracing.addCommittedTransactions(secondTransactionSetVsyncId, 0, secondUpdate, {}, false);
     flush();
 
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     ASSERT_EQ(proto.entry().size(), 2);
     verifyEntry(proto.entry(0), firstUpdate.transactions, firstTransactionSetVsyncId);
     verifyEntry(proto.entry(1), secondUpdate.transactions, secondTransactionSetVsyncId);
@@ -203,7 +203,7 @@
     while (bufferFront().vsync_id() <= VSYNC_ID_FIRST_LAYER_CHANGE) {
         queueAndCommitTransaction(++mVsyncId);
     }
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     // verify we can still retrieve the layer change from the first entry containing starting
     // states.
     EXPECT_GT(proto.entry().size(), 0);
@@ -221,7 +221,7 @@
     while (bufferFront().vsync_id() <= VSYNC_ID_SECOND_LAYER_CHANGE) {
         queueAndCommitTransaction(++mVsyncId);
     }
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     // verify starting states are updated correctly
     EXPECT_EQ(proto.entry(0).transactions(0).layer_changes(0).z(), 41);
 }
@@ -231,7 +231,7 @@
     while (bufferFront().vsync_id() <= VSYNC_ID_CHILD_LAYER_REMOVED) {
         queueAndCommitTransaction(++mVsyncId);
     }
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     // verify the child layer has been removed from the trace
     EXPECT_EQ(proto.entry(0).transactions(0).layer_changes().size(), 1);
     EXPECT_EQ(proto.entry(0).transactions(0).layer_changes(0).layer_id(), mParentLayerId);
@@ -242,7 +242,7 @@
     while (bufferFront().vsync_id() <= VSYNC_ID_SECOND_LAYER_CHANGE) {
         queueAndCommitTransaction(++mVsyncId);
     }
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     // verify we have two starting states
     EXPECT_EQ(proto.entry(0).transactions(0).layer_changes().size(), 2);
 
@@ -302,7 +302,7 @@
 };
 
 TEST_F(TransactionTracingMirrorLayerTest, canAddMirrorLayers) {
-    proto::TransactionTraceFile proto = writeToProto();
+    perfetto::protos::TransactionTraceFile proto = writeToProto();
     // We don't have any starting states since no layer was removed from.
     EXPECT_EQ(proto.entry().size(), 1);
 
@@ -317,18 +317,18 @@
 // Verify we can write the layers traces by entry to reduce mem pressure
 // on the system when generating large traces.
 TEST(LayerTraceTest, canStreamLayersTrace) {
-    LayersTraceFileProto inProto = LayerTracing::createTraceFileProto();
+    perfetto::protos::LayersTraceFileProto inProto = LayerTracing::createTraceFileProto();
     inProto.add_entry();
     inProto.add_entry();
 
     std::string output;
     inProto.SerializeToString(&output);
-    LayersTraceFileProto inProto2 = LayerTracing::createTraceFileProto();
+    perfetto::protos::LayersTraceFileProto inProto2 = LayerTracing::createTraceFileProto();
     inProto2.add_entry();
     std::string output2;
     inProto2.SerializeToString(&output2);
 
-    LayersTraceFileProto outProto;
+    perfetto::protos::LayersTraceFileProto outProto;
     outProto.ParseFromString(output + output2);
     // magic?
     EXPECT_EQ(outProto.entry().size(), 3);
