Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb3adbae authored by Yiwei Zhang's avatar Yiwei Zhang Committed by android-build-merger
Browse files

Merge "GpuStats: add render api versions to global stats" into qt-dev

am: 7d35c0d9

Change-Id: I70737db0967fb4b37e68d2cae8a75e00e45416cd
parents 02f98c70 7d35c0d9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6131,6 +6131,15 @@ message GpuStatsGlobalInfo {

    // Total count of the Vulkan driver fails to be loaded.
    optional int64 vk_loading_failure_count = 8;

    // Api version of the system Vulkan driver.
    optional int32 vulkan_version = 9;

    // Api version of the system CPU Vulkan driver.
    optional int32 cpu_vulkan_version = 10;

    // Api version of the system GLES driver.
    optional int32 gles_version = 11;
}

/**
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@ static bool pullGpuStatsGlobalInfo(const sp<IGpuService>& gpuService,
        if (!event->write((int64_t)info.glLoadingFailureCount)) return false;
        if (!event->write((int64_t)info.vkLoadingCount)) return false;
        if (!event->write((int64_t)info.vkLoadingFailureCount)) return false;
        if (!event->write(info.vulkanVersion)) return false;
        if (!event->write(info.cpuVulkanVersion)) return false;
        if (!event->write(info.glesVersion)) return false;
        event->init();
        data->emplace_back(event);
    }
+10 −1
Original line number Diff line number Diff line
@@ -48,7 +48,10 @@ static const int64_t GL_DRIVER_LOADING_TIME_1 = 666;
static const int64_t VK_DRIVER_LOADING_TIME_0   = 777;
static const int64_t VK_DRIVER_LOADING_TIME_1   = 888;
static const int64_t VK_DRIVER_LOADING_TIME_2   = 999;
static const size_t NUMBER_OF_VALUES_GLOBAL     = 8;
static const int32_t VULKAN_VERSION             = 1;
static const int32_t CPU_VULKAN_VERSION         = 2;
static const int32_t GLES_VERSION               = 3;
static const size_t NUMBER_OF_VALUES_GLOBAL     = 11;
static const size_t NUMBER_OF_VALUES_APP        = 4;
// clang-format on

@@ -93,6 +96,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) {
    EXPECT_TRUE(event->write(GL_LOADING_FAILURE_COUNT));
    EXPECT_TRUE(event->write(VK_LOADING_COUNT));
    EXPECT_TRUE(event->write(VK_LOADING_FAILURE_COUNT));
    EXPECT_TRUE(event->write(VULKAN_VERSION));
    EXPECT_TRUE(event->write(CPU_VULKAN_VERSION));
    EXPECT_TRUE(event->write(GLES_VERSION));
    event->init();
    inData.emplace_back(event);
    MockGpuStatsPuller mockPuller(android::util::GPU_STATS_GLOBAL_INFO, &inData);
@@ -110,6 +116,9 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsGlobalInfo) {
    EXPECT_EQ(GL_LOADING_FAILURE_COUNT, outData[0]->getValues()[5].mValue.long_value);
    EXPECT_EQ(VK_LOADING_COUNT, outData[0]->getValues()[6].mValue.long_value);
    EXPECT_EQ(VK_LOADING_FAILURE_COUNT, outData[0]->getValues()[7].mValue.long_value);
    EXPECT_EQ(VULKAN_VERSION, outData[0]->getValues()[8].mValue.int_value);
    EXPECT_EQ(CPU_VULKAN_VERSION, outData[0]->getValues()[9].mValue.int_value);
    EXPECT_EQ(GLES_VERSION, outData[0]->getValues()[10].mValue.int_value);
}

TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) {