diff --git a/runtime/aub_mem_dump/aub_mem_dump.h b/runtime/aub_mem_dump/aub_mem_dump.h index f0199018db..230cd37e90 100644 --- a/runtime/aub_mem_dump/aub_mem_dump.h +++ b/runtime/aub_mem_dump/aub_mem_dump.h @@ -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; diff --git a/runtime/command_stream/aub_command_stream_receiver.cpp b/runtime/command_stream/aub_command_stream_receiver.cpp index 26fbc5c823..c031087da9 100644 --- a/runtime/command_stream/aub_command_stream_receiver.cpp +++ b/runtime/command_stream/aub_command_stream_receiver.cpp @@ -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(&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; diff --git a/unit_tests/aub_tests/command_stream/aub_command_stream_fixture.h b/unit_tests/aub_tests/command_stream/aub_command_stream_fixture.h index 84171856fb..db16950c2e 100644 --- a/unit_tests/aub_tests/command_stream/aub_command_stream_fixture.h +++ b/unit_tests/aub_tests/command_stream/aub_command_stream_fixture.h @@ -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(reinterpret_cast(srcAddress) + offset), - size); + size, + AubMemDump::CmdServicesMemTraceMemoryCompare::AddressSpaceValues::TraceNonlocal); }; aubCsr->ppgtt->pageWalk(reinterpret_cast(gfxAddress), length, 0, 0, walker, PageTableHelper::memoryBankNotSpecified); diff --git a/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp b/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp index b3c576249a..bf631d002e 100644 --- a/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp +++ b/unit_tests/aub_tests/command_stream/aub_mem_dump_tests.cpp @@ -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 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 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(); }