From 6ea2d8c2a9a901c536314fe4a4b3abee22b0e5f9 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Wed, 9 Jan 2019 14:23:49 +0100 Subject: [PATCH] Extract creating aub file name to separate function Change-Id: Ie0506f1847684cc3aabd8bee153c944b2f49bdb8 Signed-off-by: Dunajski, Bartosz --- .../command_stream/aub_command_stream_receiver.cpp | 11 ++++++++--- runtime/command_stream/aub_command_stream_receiver.h | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/runtime/command_stream/aub_command_stream_receiver.cpp b/runtime/command_stream/aub_command_stream_receiver.cpp index ba6a078c19..ee98b7bc57 100644 --- a/runtime/command_stream/aub_command_stream_receiver.cpp +++ b/runtime/command_stream/aub_command_stream_receiver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,14 +18,14 @@ namespace OCLRT { AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {}; -CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment) { +std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename) { std::string hwPrefix = hardwarePrefix[hwInfo.pPlatform->eProductFamily]; // Generate the full filename const auto >SystemInfo = *hwInfo.pSysInfo; std::stringstream strfilename; uint32_t subSlicesPerSlice = gtSystemInfo.SubSliceCount / gtSystemInfo.SliceCount; - strfilename << hwPrefix << "_" << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << baseName << ".aub"; + strfilename << hwPrefix << "_" << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub"; // clean-up any fileName issues because of the file system incompatibilities auto fileName = strfilename.str(); @@ -37,6 +37,11 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwIn filePath.append(Os::fileSeparator); filePath.append(fileName); + return filePath; +} + +CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment) { + std::string filePath = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get()); } diff --git a/runtime/command_stream/aub_command_stream_receiver.h b/runtime/command_stream/aub_command_stream_receiver.h index 3dec98a525..0520773285 100644 --- a/runtime/command_stream/aub_command_stream_receiver.h +++ b/runtime/command_stream/aub_command_stream_receiver.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,6 +16,7 @@ class ExecutionEnvironment; struct AUBCommandStreamReceiver { static CommandStreamReceiver *create(const HardwareInfo &hwInfo, const std::string &filename, bool standalone, ExecutionEnvironment &executionEnvironment); + static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename); using AubFileStream = AubMemDump::AubFileStream; };