gfxstream: Update GfxApiLogger namespace and header file

... to parallel the changes in ag/33517750.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35323>
This commit is contained in:
Jason Macnak
2025-05-12 23:41:41 +00:00
committed by Marge Bot
parent dae39cd278
commit e7826d89a7
2 changed files with 22 additions and 7 deletions
@@ -56,8 +56,6 @@ decoder_snapshot_decl_postamble = """
decoder_snapshot_impl_preamble ="""
using emugl::GfxApiLogger;
namespace gfxstream {
namespace vk {
@@ -204,6 +204,22 @@ copyrightHeader = """// Copyright (C) 2018 The Android Open Source Project
// limitations under the License.
"""
coprightHeaderPy = """# Copyright (C) 2025 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
# We put the long generated commands in a separate paragraph, so that the formatter won't mess up
# with other texts.
autogeneratedHeaderTemplate = """
@@ -281,8 +297,6 @@ class CerealGenerator(OutputGenerator):
self.featureSupported = False
self.supportedModules = None
self.utilsHeaderDirPrefix = "utils"
# The cereal variant should be an environmental variable of one of
# the following:
# - "guest"
@@ -493,8 +507,8 @@ using DlSymFunc = void* (void*, const char*);
#include <memory>
#include "VkSnapshotApiCall.h"
#include "{self.utilsHeaderDirPrefix}/GfxApiLogger.h"
#include "gfxstream/HealthMonitor.h"
#include "gfxstream/host/GfxApiLogger.h"
#include "goldfish_vk_private_defs.h"
"""
decoderSnapshotImplIncludes = f"""
@@ -650,7 +664,8 @@ class BumpPool;
implOnly=True)
self.addModule(cereal.PyScript(self.host_tag, "vulkan_printer", customAbsDir=Path(
self.host_script_destination) / "print_gfx_logs"), moduleName="ApiLogDecoder")
self.host_script_destination) / "print_gfx_logs"), moduleName="ApiLogDecoder",
extraHeader=coprightHeaderPy)
self.addHostModule(
"vulkan_gfxstream_structure_type", headerOnly=True, suppressFeatureGuards=True,
moduleName="vulkan_gfxstream_structure_type_host", useNamespace=False,
@@ -704,10 +719,12 @@ class BumpPool;
suppressFeatureGuards=suppressFeatureGuards, moduleName=moduleName,
suppressVulkanHeaders=suppressVulkanHeaders)
def addModule(self, module, moduleName=None):
def addModule(self, module, moduleName=None, extraHeader=None):
if moduleName is None:
moduleName = module.basename
self.moduleList.append(moduleName)
if extraHeader:
module.preamble = extraHeader
self.modules[moduleName] = module
def addCppModule(