Add ids to transactions and dump them in transaction trace
This is required for associating dumped transactions merges on the client side to dump transaction traces on the server side
Test: Make sure a transaction id is present in the dump
Change-Id: I8d3ad102bedb839901f0a818779c7d35519c669a
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 3627deb..3e3570d 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -157,7 +157,7 @@
uint32_t flags, const sp<IBinder>& applyToken,
const InputWindowCommands& inputWindowCommands, int64_t desiredPresentTime,
const client_cache_t& uncacheBuffer, bool hasListenerCallbacks,
- const std::vector<ListenerCallbacks>& listenerCallbacks) = 0;
+ const std::vector<ListenerCallbacks>& listenerCallbacks, uint64_t transactionId) = 0;
/* signal that we're done booting.
* Requires ACCESS_SURFACE_FLINGER permission
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index 6cac287..bbe3893 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -339,12 +339,18 @@
};
class Transaction : public Parcelable {
+ private:
+ static std::atomic<uint32_t> idCounter;
+ int64_t generateId();
+
protected:
std::unordered_map<sp<IBinder>, ComposerState, IBinderHash> mComposerStates;
SortedVector<DisplayState > mDisplayStates;
std::unordered_map<sp<ITransactionCompletedListener>, CallbackInfo, TCLHash>
mListenerCallbacks;
+ uint64_t mId;
+
uint32_t mForceSynchronous = 0;
uint32_t mTransactionNestCount = 0;
bool mAnimation = false;
@@ -380,7 +386,7 @@
void registerSurfaceControlForCallback(const sp<SurfaceControl>& sc);
public:
- Transaction() = default;
+ Transaction();
virtual ~Transaction() = default;
Transaction(Transaction const& other);