mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 17:41:26 +08:00
Zebin manipulator - create dump directory fix
This commit fixes problem in zebin manipulator when dump was not created. * Explicitly create dump directory. * Add slash to dump argument. Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c7cb71e174
commit
0ef6b9b64c
@@ -13,10 +13,10 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class Directory {
|
||||
public:
|
||||
static std::vector<std::string> getFiles(const std::string &path);
|
||||
};
|
||||
namespace Directory {
|
||||
std::vector<std::string> getFiles(const std::string &path);
|
||||
void createDirectory(const std::string &path);
|
||||
} // namespace Directory
|
||||
|
||||
inline int parseBdfString(const std::string &pciBDF, uint16_t &domain, uint8_t &bus, uint8_t &device, uint8_t &function) {
|
||||
if (strlen(pciBDF.c_str()) == 12) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,10 +9,12 @@
|
||||
|
||||
#include <cstdio>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace NEO {
|
||||
namespace NEO::Directory {
|
||||
|
||||
std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
std::vector<std::string> getFiles(const std::string &path) {
|
||||
std::vector<std::string> files;
|
||||
|
||||
DIR *dir = opendir(path.c_str());
|
||||
@@ -37,4 +39,9 @@ std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
closedir(dir);
|
||||
return files;
|
||||
}
|
||||
}; // namespace NEO
|
||||
|
||||
void createDirectory(const std::string &path) {
|
||||
const mode_t mode = 0777; // 777 in base 8
|
||||
mkdir(path.c_str(), mode);
|
||||
}
|
||||
}; // namespace NEO::Directory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,9 +9,11 @@
|
||||
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
|
||||
namespace NEO {
|
||||
#include <direct.h>
|
||||
|
||||
std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
namespace NEO::Directory {
|
||||
|
||||
std::vector<std::string> getFiles(const std::string &path) {
|
||||
std::vector<std::string> files;
|
||||
std::string newPath;
|
||||
|
||||
@@ -37,4 +39,8 @@ std::vector<std::string> Directory::getFiles(const std::string &path) {
|
||||
FindClose(hFind);
|
||||
return files;
|
||||
}
|
||||
}; // namespace NEO
|
||||
|
||||
void createDirectory(const std::string &path) {
|
||||
_mkdir(path.c_str());
|
||||
}
|
||||
}; // namespace NEO::Directory
|
||||
|
||||
Reference in New Issue
Block a user