summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jerome Gaillard <jgaillard@google.com> 2024-02-27 12:46:21 +0000
committer Jerome Gaillard <jgaillard@google.com> 2024-03-04 11:25:55 +0000
commit6352d1c15638de2ca42a01510ea475825b7c4915 (patch)
tree70147f5523c6c3543160ba91360a5426041df7fc
parent8f6d6e033462c7b74f2bdf87879e26b0f0321212 (diff)
Add JankTracker to host build for libhwui
Bug: 322360037 Test: host build of libhwui Change-Id: Ic4d3c35180a188d460cd7006d02e725794324d69
-rw-r--r--libs/hwui/Android.bp2
-rw-r--r--libs/hwui/JankTracker.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index cb7c2ada2ab4..54f94f5c4b14 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -565,6 +565,7 @@ cc_defaults {
"FrameMetricsReporter.cpp",
"Gainmap.cpp",
"Interpolator.cpp",
+ "JankTracker.cpp",
"LightingInfo.cpp",
"Matrix.cpp",
"Mesh.cpp",
@@ -629,7 +630,6 @@ cc_defaults {
"DeferredLayerUpdater.cpp",
"HardwareBitmapUploader.cpp",
"HWUIProperties.sysprop",
- "JankTracker.cpp",
"Layer.cpp",
"LayerUpdateQueue.cpp",
"ProfileDataContainer.cpp",
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 4b0ddd2fa2ef..638a060bdb1c 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -17,10 +17,10 @@
#include "JankTracker.h"
#include <cutils/ashmem.h>
+#include <cutils/trace.h>
#include <errno.h>
#include <inttypes.h>
#include <log/log.h>
-#include <sys/mman.h>
#include <algorithm>
#include <cmath>
@@ -278,7 +278,7 @@ void JankTracker::recomputeThresholds(int64_t frameBudget) REQUIRES(mDataMutex)
void JankTracker::dumpData(int fd, const ProfileDataDescription* description,
const ProfileData* data) {
-
+#ifdef __ANDROID__
if (description) {
switch (description->type) {
case JankTrackerType::Generic:
@@ -296,9 +296,11 @@ void JankTracker::dumpData(int fd, const ProfileDataDescription* description,
}
data->dump(fd);
dprintf(fd, "\n");
+#endif
}
void JankTracker::dumpFrames(int fd) {
+#ifdef __ANDROID__
dprintf(fd, "\n\n---PROFILEDATA---\n");
for (size_t i = 0; i < static_cast<size_t>(FrameInfoIndex::NumIndexes); i++) {
dprintf(fd, "%s", FrameInfoNames[i]);
@@ -315,6 +317,7 @@ void JankTracker::dumpFrames(int fd) {
}
}
dprintf(fd, "\n---PROFILEDATA---\n\n");
+#endif
}
void JankTracker::reset() REQUIRES(mDataMutex) {