Dump last committed vSyncId on layers trace start

Keep track of the last committed vSyncId to dump it when we start the layers trace

Bug: 230462538

Test: Check a vSyncId is dumped in the first entry of the layers trace
Change-Id: Ie4c48acf99057cdb8bfebbf5cea3729ab5014bd4
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 446d744..9abee99 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2170,6 +2170,7 @@
         // This will block and tracing should only be enabled for debugging.
         mLayerTracing.notify(mVisibleRegionsDirty, frameTime, vsyncId);
     }
+    mLastCommittedVsyncId = vsyncId;
 
     persistDisplayBrightness(mustComposite);
 
@@ -5847,7 +5848,7 @@
                         mScheduler
                                 ->schedule([&]() FTL_FAKE_GUARD(mStateLock) {
                                     mLayerTracing.notify(true /* visibleRegionDirty */,
-                                                         startingTime, -1 /* vsyncId */);
+                                                         startingTime, mLastCommittedVsyncId);
                                 })
                                 .wait();
                     }