2018-06-13 02:33:03 +08:00
|
|
|
/*
|
2022-09-01 23:54:57 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-06-13 02:33:03 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-06-13 02:33:03 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-07-02 00:44:29 +08:00
|
|
|
#pragma once
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_subcapture.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-07-02 00:44:29 +08:00
|
|
|
|
2018-06-13 02:33:03 +08:00
|
|
|
class AubSubCaptureManagerMock : public AubSubCaptureManager {
|
|
|
|
public:
|
2020-10-15 01:22:01 +08:00
|
|
|
AubSubCaptureManagerMock(const std::string &fileName, AubSubCaptureCommon &subCaptureCommon)
|
2021-12-21 02:16:04 +08:00
|
|
|
: AubSubCaptureManager(fileName, subCaptureCommon, "") {}
|
2018-07-09 17:31:36 +08:00
|
|
|
|
2018-06-13 02:33:03 +08:00
|
|
|
void setSubCaptureIsActive(bool on) {
|
|
|
|
subCaptureIsActive = on;
|
|
|
|
}
|
|
|
|
bool isSubCaptureActive() const {
|
|
|
|
return subCaptureIsActive;
|
|
|
|
}
|
2019-06-03 15:57:27 +08:00
|
|
|
void setSubCaptureWasActiveInPreviousEnqueue(bool on) {
|
|
|
|
subCaptureWasActiveInPreviousEnqueue = on;
|
2018-06-13 02:33:03 +08:00
|
|
|
}
|
2019-06-03 15:57:27 +08:00
|
|
|
bool wasSubCaptureActiveInPreviousEnqueue() const {
|
|
|
|
return subCaptureWasActiveInPreviousEnqueue;
|
2018-06-13 02:33:03 +08:00
|
|
|
}
|
|
|
|
void setKernelCurrentIndex(uint32_t index) {
|
|
|
|
kernelCurrentIdx = index;
|
|
|
|
}
|
2018-07-02 00:44:29 +08:00
|
|
|
uint32_t getKernelCurrentIndex() const {
|
2018-06-13 02:33:03 +08:00
|
|
|
return kernelCurrentIdx;
|
|
|
|
}
|
2019-10-07 04:51:15 +08:00
|
|
|
bool getUseToggleFileName() const {
|
|
|
|
return useToggleFileName;
|
2018-07-09 17:31:36 +08:00
|
|
|
}
|
|
|
|
const std::string &getInitialFileName() const {
|
|
|
|
return initialFileName;
|
|
|
|
}
|
|
|
|
const std::string &getCurrentFileName() const {
|
|
|
|
return currentFileName;
|
|
|
|
}
|
2018-07-02 00:44:29 +08:00
|
|
|
SettingsReader *getSettingsReader() const {
|
|
|
|
return settingsReader.get();
|
|
|
|
}
|
2018-06-13 02:33:03 +08:00
|
|
|
void setSubCaptureToggleActive(bool on) {
|
|
|
|
isToggledOn = on;
|
|
|
|
}
|
|
|
|
bool isSubCaptureToggleActive() const override {
|
|
|
|
return isToggledOn;
|
|
|
|
}
|
2019-10-07 04:51:15 +08:00
|
|
|
void setToggleFileName(const std::string &fileName) {
|
|
|
|
toggleFileName = fileName;
|
2018-07-09 17:31:36 +08:00
|
|
|
}
|
2019-10-07 04:51:15 +08:00
|
|
|
std::string getToggleFileName() const override {
|
|
|
|
return toggleFileName;
|
2018-07-09 17:31:36 +08:00
|
|
|
}
|
|
|
|
|
2022-09-01 23:54:57 +08:00
|
|
|
[[nodiscard]] std::unique_lock<std::mutex> lock() const override {
|
2019-05-17 07:14:06 +08:00
|
|
|
isLocked = true;
|
|
|
|
return std::unique_lock<std::mutex>{mutex};
|
|
|
|
}
|
|
|
|
|
2018-07-09 17:31:36 +08:00
|
|
|
using AubSubCaptureManager::generateFilterFileName;
|
|
|
|
using AubSubCaptureManager::generateToggleFileName;
|
2019-10-07 04:51:15 +08:00
|
|
|
using AubSubCaptureManager::getAubCaptureFileName;
|
2018-06-13 02:33:03 +08:00
|
|
|
|
2019-05-17 07:14:06 +08:00
|
|
|
mutable bool isLocked = false;
|
|
|
|
|
2018-06-13 02:33:03 +08:00
|
|
|
protected:
|
|
|
|
bool isToggledOn = false;
|
2019-10-07 04:51:15 +08:00
|
|
|
std::string toggleFileName = "";
|
2018-06-13 02:33:03 +08:00
|
|
|
};
|