summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-01-03 23:51:00 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-01-03 23:51:00 +0000
commitebab3d10cb574a2d3e3cec573f3a659f31a73e8c (patch)
tree1c9c94306263e20ab030758216a69ac6e72e5f9a
parentbc9dc45871401d6de74be22121009f68dda004c7 (diff)
parentf02cf6b7d5dc086613b2e580dc84fb4987695872 (diff)
Merge "GpuStats: track whether the app creates ES1 context"
-rw-r--r--cmds/statsd/src/atoms.proto3
-rw-r--r--cmds/statsd/src/external/GpuStatsPuller.cpp1
-rw-r--r--cmds/statsd/tests/external/GpuStatsPuller_test.cpp5
3 files changed, 8 insertions, 1 deletions
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 815e3e668d31..19b9709e1d41 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -6691,6 +6691,9 @@ message GpuStatsAppInfo {
// App is not doing pre-rotation correctly.
optional bool false_prerotation = 7;
+
+ // App creates GLESv1 context.
+ optional bool gles_1_in_use = 8;
}
/*
diff --git a/cmds/statsd/src/external/GpuStatsPuller.cpp b/cmds/statsd/src/external/GpuStatsPuller.cpp
index d38b87f046e0..3229ba82fe3c 100644
--- a/cmds/statsd/src/external/GpuStatsPuller.cpp
+++ b/cmds/statsd/src/external/GpuStatsPuller.cpp
@@ -103,6 +103,7 @@ static bool pullGpuStatsAppInfo(const sp<IGpuService>& gpuService,
}
if (!event->write(info.cpuVulkanInUse)) return false;
if (!event->write(info.falsePrerotation)) return false;
+ if (!event->write(info.gles1InUse)) return false;
event->init();
data->emplace_back(event);
}
diff --git a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
index 6abdfa3dbb24..ae92705aff4c 100644
--- a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
+++ b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp
@@ -58,8 +58,9 @@ static const int32_t CPU_VULKAN_VERSION = 2;
static const int32_t GLES_VERSION = 3;
static const bool CPU_VULKAN_IN_USE = true;
static const bool FALSE_PREROTATION = true;
+static const bool GLES_1_IN_USE = true;
static const size_t NUMBER_OF_VALUES_GLOBAL = 13;
-static const size_t NUMBER_OF_VALUES_APP = 7;
+static const size_t NUMBER_OF_VALUES_APP = 8;
// clang-format on
class MockGpuStatsPuller : public GpuStatsPuller {
@@ -153,6 +154,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) {
EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime)));
EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE));
EXPECT_TRUE(event->write(FALSE_PREROTATION));
+ EXPECT_TRUE(event->write(GLES_1_IN_USE));
event->init();
inData.emplace_back(event);
MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData);
@@ -172,6 +174,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) {
outData[0]->getValues()[4].mValue.str_value);
EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value);
EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value);
+ EXPECT_EQ(GLES_1_IN_USE, outData[0]->getValues()[7].mValue.int_value);
}
} // namespace statsd