refactor: add mock_aubstream

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2024-04-25 13:47:06 +00:00
committed by Compute-Runtime-Automation
parent 4aa7c6c99e
commit cbc868c4ed
22 changed files with 102 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2023 Intel Corporation
# Copyright (C) 2020-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -17,19 +17,6 @@ set(NEO_CORE_AUB_MEM_DUMP
${CMAKE_CURRENT_SOURCE_DIR}/page_table_entry_bits.h
)
if(NOT DEFINED AUB_STREAM_PROJECT_NAME)
list(APPEND NEO_CORE_AUB_MEM_DUMP
${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_stubs.cpp
)
else()
add_library(aub_stream_stubs STATIC
${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_stubs.cpp
)
target_include_directories(aub_stream_stubs PRIVATE
${AUB_STREAM_HEADERS_DIR}
)
endif()
if(SUPPORT_XEHP_AND_LATER)
list(APPEND NEO_CORE_AUB_MEM_DUMP
${CMAKE_CURRENT_SOURCE_DIR}/aub_mem_dump_xehp_and_later.inl

View File

@@ -1,34 +0,0 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "aubstream/aubstream.h"
#include <limits>
namespace aub_stream_stubs {
uint16_t tbxServerPort = 4321;
std::string tbxServerIp = "127.0.0.1";
bool tbxFrontdoorMode = false;
uint32_t aubStreamCaller = std::numeric_limits<uint32_t>::max();
} // namespace aub_stream_stubs
namespace aub_stream {
extern "C" {
void injectMMIOList(MMIOList mmioList){};
void setTbxServerPort(uint16_t port) { aub_stream_stubs::tbxServerPort = port; };
void setTbxServerIp(std::string server) {
// better to avoid reassigning global variables which assume memory allocations since
// we could step into false-positive memory leak detection with embedded leak check helper
if (aub_stream_stubs::tbxServerIp != server)
aub_stream_stubs::tbxServerIp = server;
};
void setTbxFrontdoorMode(bool frontdoor) { aub_stream_stubs::tbxFrontdoorMode = frontdoor; };
void setAubStreamCaller(uint32_t caller) { aub_stream_stubs::aubStreamCaller = caller; };
}
} // namespace aub_stream