Set TbxServerIp and TbxServerPort from DebugVariables
Change-Id: Ib9ba3efb3a196c1bdf5f4345b36fe35da159c29c
This commit is contained in:
parent
7d04159f76
commit
758d91f406
|
@ -22,6 +22,8 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, bool localMemoryEnabled, const
|
|||
if (DebugManager.flags.AubDumpAddMmioRegistersList.get() != "unk") {
|
||||
aub_stream::injectMMIOList = AubHelper::getAdditionalMmioList();
|
||||
}
|
||||
aub_stream::tbxServerIp = DebugManager.flags.TbxServer.get();
|
||||
aub_stream::tbxServerPort = DebugManager.flags.TbxPort.get();
|
||||
|
||||
aubManager.reset(createAubManager(pHwInfo->pPlatform->eRenderCoreFamily, devicesCount, memoryBankSize, localMemoryEnabled, aubFileName));
|
||||
}
|
||||
|
|
|
@ -11,9 +11,11 @@
|
|||
namespace aub_stream {
|
||||
|
||||
MMIOList injectMMIOList;
|
||||
std::string tbxServerIp = "127.0.0.1";
|
||||
uint16_t tbxServerPort = 4321;
|
||||
|
||||
AubManager *AubManager::create(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSizeInGB, bool localMemorySupported, const std::string &aubFileName) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace AubDump
|
||||
} // namespace aub_stream
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -9,8 +9,11 @@
|
|||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||
#include "unit_tests/helpers/variable_backup.h"
|
||||
#include "unit_tests/mocks/mock_aub_center.h"
|
||||
|
||||
#include "third_party/aub_stream/headers/options.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
using namespace OCLRT;
|
||||
|
||||
|
@ -22,3 +25,28 @@ TEST(AubCenter, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubMa
|
|||
|
||||
EXPECT_EQ(nullptr, aubCenter.aubManager.get());
|
||||
}
|
||||
|
||||
TEST(AubCenter, GivenUseAubStreamAndTbxServerIpDebugVariableSetWhenAubCenterIsCreatedThenServerIpIsModified) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.UseAubStream.set(true);
|
||||
DebugManager.flags.TbxServer.set("10.10.10.10");
|
||||
VariableBackup<std::string> backup(&aub_stream::tbxServerIp);
|
||||
|
||||
MockAubCenter aubCenter(platformDevices[0], false, "");
|
||||
|
||||
EXPECT_STREQ("10.10.10.10", aub_stream::tbxServerIp.c_str());
|
||||
}
|
||||
|
||||
TEST(AubCenter, GivenUseAubStreamAndTbxServerPortDebugVariableSetWhenAubCenterIsCreatedThenServerIpIsModified) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.UseAubStream.set(true);
|
||||
DebugManager.flags.TbxPort.set(1234);
|
||||
|
||||
VariableBackup<uint16_t> backup(&aub_stream::tbxServerPort);
|
||||
|
||||
uint16_t port = 1234u;
|
||||
EXPECT_NE(port, aub_stream::tbxServerPort);
|
||||
|
||||
MockAubCenter aubCenter(platformDevices[0], false, "");
|
||||
EXPECT_EQ(port, aub_stream::tbxServerPort);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue