Add AIL functionality

Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
Kamil Diedrich
2021-07-21 08:47:43 +00:00
committed by Compute-Runtime-Automation
parent ab73b61b77
commit 2afb785bba
29 changed files with 396 additions and 18 deletions

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/source/os_interface/linux/sys_calls.h"
#include <string_view>
namespace NEO {
bool AILConfiguration::initProcessExecutableName() {
char path[512] = {0};
int result = SysCalls::readlink("/proc/self/exe", path, sizeof(path) - 1);
if (result == -1) {
return false;
}
path[result] = '\0';
std::string_view pathView(path);
auto lastPosition = pathView.find_last_of("/");
pathView.remove_prefix(lastPosition + 1u);
processName = pathView;
return true;
}
} // namespace NEO