Create a wrapper for atrace macros
Create a SF specific macro to call into atrace. This will make the
switch to perfetto for capturing atrace tags easier.
Flag: EXEMPT refactor
Bug: 349905670
Test: perfetto
Change-Id: I4d046d837f52ef78b08e3c97556f2eddb06232dd
diff --git a/services/surfaceflinger/HdrLayerInfoReporter.cpp b/services/surfaceflinger/HdrLayerInfoReporter.cpp
index 2788332..85921bb 100644
--- a/services/surfaceflinger/HdrLayerInfoReporter.cpp
+++ b/services/surfaceflinger/HdrLayerInfoReporter.cpp
@@ -19,8 +19,8 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <android-base/stringprintf.h>
+#include <common/trace.h>
#include <inttypes.h>
-#include <utils/Trace.h>
#include "HdrLayerInfoReporter.h"
@@ -29,7 +29,7 @@
using base::StringAppendF;
void HdrLayerInfoReporter::dispatchHdrLayerInfo(const HdrLayerInfo& info) {
- ATRACE_CALL();
+ SFTRACE_CALL();
if (mHdrInfoHistory.size() == 0 || mHdrInfoHistory.back().info != info) {
mHdrInfoHistory.next() = EventHistoryEntry{info};
}
@@ -47,7 +47,7 @@
}
for (const auto& listener : toInvoke) {
- ATRACE_NAME("invoking onHdrLayerInfoChanged");
+ SFTRACE_NAME("invoking onHdrLayerInfoChanged");
listener->onHdrLayerInfoChanged(info.numberOfHdrLayers, info.maxW, info.maxH, info.flags,
info.maxDesiredHdrSdrRatio);
}