summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/DisplayDevice.h
diff options
context:
space:
mode:
author Dominik Laskowski <domlaskowski@google.com> 2023-10-13 18:35:37 -0400
committer Dominik Laskowski <domlaskowski@google.com> 2023-11-13 11:14:08 -0500
commit0784adc153b98f5babb56868f080f5dc91675b8c (patch)
tree8967f745c6701592a5e8a8a8c028098c57c26a26 /services/surfaceflinger/DisplayDevice.h
parent9eb43e9fe10961c9adedb4b9a16960e08d871292 (diff)
SF: Deduplicate ID concat of DisplayDevice traces
Bug: 241285876 Test: Perfetto Change-Id: Ibe39de0f144066be8c6111915d9c1394565ec541
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.h')
-rw-r--r--services/surfaceflinger/DisplayDevice.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index a044534964..a40f310711 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -269,6 +269,11 @@ public:
void dump(utils::Dumper&) const;
private:
+ template <size_t N>
+ inline std::string concatId(const char (&str)[N]) const {
+ return std::string(ftl::Concat(str, ' ', getId().value).str());
+ }
+
const sp<SurfaceFlinger> mFlinger;
HWComposer& mHwComposer;
const wp<IBinder> mDisplayToken;
@@ -316,8 +321,7 @@ private:
mutable std::mutex mActiveModeLock;
ActiveModeInfo mDesiredActiveMode GUARDED_BY(mActiveModeLock);
- TracedOrdinal<bool> mDesiredActiveModeChanged GUARDED_BY(mActiveModeLock) =
- {ftl::Concat("DesiredActiveModeChanged-", getId().value).c_str(), false};
+ TracedOrdinal<bool> mDesiredActiveModeChanged GUARDED_BY(mActiveModeLock);
ActiveModeInfo mUpcomingActiveMode GUARDED_BY(kMainThreadContext);
bool mIsModeSetPending GUARDED_BY(kMainThreadContext) = false;