Add addressSpace to AubFileStream::expectMemory

- addressSpace can be passed as argument from layers above
where address space is known

Change-Id: If9075dde4e207296df91b46eccecd0b5fa183aa9
This commit is contained in:
Hoppe, Mateusz
2018-09-19 06:09:03 -07:00
committed by sys_ocldev
parent 070bbf4033
commit c39f9c0c66
4 changed files with 16 additions and 59 deletions

View File

@@ -1,23 +1,8 @@
/*
* Copyright (c) 2017 - 2018, Intel Corporation
* Copyright (C) 2017-2018 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* SPDX-License-Identifier: MIT
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
@@ -150,7 +135,7 @@ struct AubFileStream : public AubStream {
const std::string &getFileName() const { return fileName; }
MOCKABLE_VIRTUAL void write(const char *data, size_t size);
MOCKABLE_VIRTUAL void flush();
MOCKABLE_VIRTUAL void expectMemory(uint64_t physAddress, const void *memory, size_t size);
MOCKABLE_VIRTUAL void expectMemory(uint64_t physAddress, const void *memory, size_t size, uint32_t addressSpace);
MOCKABLE_VIRTUAL bool addComment(const char *message);
std::ofstream fileHandle;

View File

@@ -1,23 +1,8 @@
/*
* Copyright (c) 2017 - 2018, Intel Corporation
* Copyright (C) 2017-2018 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* SPDX-License-Identifier: MIT
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/command_stream/aub_command_stream_receiver.h"
@@ -190,7 +175,7 @@ void AubFileStream::registerPoll(uint32_t registerOffset, uint32_t mask, uint32_
write(reinterpret_cast<char *>(&header), sizeof(header));
}
void AubFileStream::expectMemory(uint64_t physAddress, const void *memory, size_t sizeRemaining) {
void AubFileStream::expectMemory(uint64_t physAddress, const void *memory, size_t sizeRemaining, uint32_t addressSpace) {
using CmdServicesMemTraceMemoryCompare = AubMemDump::CmdServicesMemTraceMemoryCompare;
CmdServicesMemTraceMemoryCompare header = {};
header.setHeader();
@@ -200,7 +185,7 @@ void AubFileStream::expectMemory(uint64_t physAddress, const void *memory, size_
header.tiling = CmdServicesMemTraceMemoryCompare::TilingValues::NoTiling;
header.crcCompare = CmdServicesMemTraceMemoryCompare::CrcCompareValues::NoCrc;
header.dataTypeHint = CmdServicesMemTraceMemoryCompare::DataTypeHintValues::TraceNotype;
header.addressSpace = CmdServicesMemTraceMemoryCompare::AddressSpaceValues::TraceNonlocal;
header.addressSpace = addressSpace;
auto headerSize = sizeof(CmdServicesMemTraceMemoryCompare) - sizeof(CmdServicesMemTraceMemoryCompare::data);
auto blockSizeMax = g_dwordCountMax * sizeof(uint32_t) - headerSize;

View File

@@ -6,6 +6,7 @@
*/
#pragma once
#include "runtime/aub_mem_dump/aub_mem_dump.h"
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
#include "runtime/command_stream/command_stream_receiver_with_aub_dump.h"
#include "runtime/command_stream/tbx_command_stream_receiver_hw.h"
@@ -62,7 +63,8 @@ class AUBCommandStreamFixture : public CommandStreamFixture {
aubCsr->stream->expectMemory(physAddress,
reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(srcAddress) + offset),
size);
size,
AubMemDump::CmdServicesMemTraceMemoryCompare::AddressSpaceValues::TraceNonlocal);
};
aubCsr->ppgtt->pageWalk(reinterpret_cast<uintptr_t>(gfxAddress), length, 0, 0, walker, PageTableHelper::memoryBankNotSpecified);

View File

@@ -1,23 +1,8 @@
/*
* Copyright (c) 2017 - 2018, Intel Corporation
* Copyright (C) 2017-2018 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* SPDX-License-Identifier: MIT
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "aub_mem_dump_tests.h"
@@ -120,7 +105,7 @@ HWTEST_F(AubMemDumpTests, writeVerifyOneBytePPGTT) {
OCLRT::AubHelperHw<FamilyType> aubHelperHw(false);
AUB::reserveAddressPPGTT(aubFile, gAddress, sizeof(byte), physAddress, 7, aubHelperHw);
AUB::addMemoryWrite(aubFile, physAddress, &byte, sizeof(byte), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.expectMemory(physAddress, &byte, sizeof(byte));
aubFile.expectMemory(physAddress, &byte, sizeof(byte), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.fileHandle.close();
}
@@ -142,7 +127,7 @@ HWTEST_F(AubMemDumpTests, writeVerifyOneByteGGTT) {
AubGTTData data = {true, false};
AUB::reserveAddressGGTT(aubFile, &byte, sizeof(byte), physAddress, data);
AUB::addMemoryWrite(aubFile, physAddress, &byte, sizeof(byte), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.expectMemory(physAddress, &byte, sizeof(byte));
aubFile.expectMemory(physAddress, &byte, sizeof(byte), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.fileHandle.close();
}
@@ -166,7 +151,7 @@ HWTEST_F(AubMemDumpTests, writeVerifySevenBytesPPGTT) {
OCLRT::AubHelperHw<FamilyType> aubHelperHw(false);
AUB::reserveAddressPPGTT(aubFile, gAddress, sizeof(bytes), physAddress, 7, aubHelperHw);
AUB::addMemoryWrite(aubFile, physAddress, bytes, sizeof(bytes), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.expectMemory(physAddress, bytes, sizeof(bytes));
aubFile.expectMemory(physAddress, bytes, sizeof(bytes), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.fileHandle.close();
}
@@ -188,7 +173,7 @@ HWTEST_F(AubMemDumpTests, writeVerifySevenBytesGGTT) {
AubGTTData data = {true, false};
AUB::reserveAddressGGTT(aubFile, bytes, sizeof(bytes), physAddress, data);
AUB::addMemoryWrite(aubFile, physAddress, bytes, sizeof(bytes), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.expectMemory(physAddress, bytes, sizeof(bytes));
aubFile.expectMemory(physAddress, bytes, sizeof(bytes), AubMemDump::AddressSpaceValues::TraceNonlocal);
aubFile.fileHandle.close();
}