[SDK] Remove std::regex usage from rocprofiler-sdk library and common library (#421)

* Remove std::regex usage from rocprofiler-sdk and common library

- See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118408
- std::regex usage produces exceptions or segfaults when used when on applications compiled with dual ABI
- Add code restrictions workflow
  - simple workflow ensuring code restrictions (such as std::regex) are not used

* Update CHANGELOG

* Explicitly set permissions for restrictions workflow

* Fix handling of /proc/cpuinfo entries with no info

- e.g. "power_management:" (colon is last character)

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Этот коммит содержится в:
Madsen, Jonathan
2025-05-29 23:11:13 -05:00
коммит произвёл GitHub
родитель 7f22b66a9b
Коммит dbb2e52216
12 изменённых файлов: 212 добавлений и 47 удалений
+3 -4
Просмотреть файл
@@ -34,7 +34,6 @@
#include <iomanip>
#include <iostream>
#include <map>
#include <regex>
#include <set>
#include <string>
#include <vector>
@@ -78,16 +77,16 @@ ElfInfo::ElfInfo(std::string _fname)
{}
bool
ElfInfo::has_symbol(std::regex&& _re) const
ElfInfo::has_symbol(const std::function<bool(std::string_view)>& _checker) const
{
for(const auto& itr : symbol_entries)
{
if(!itr.name.empty() && std::regex_search(itr.name, _re)) return true;
if(!itr.name.empty() && _checker(itr.name)) return true;
}
// For stripped binaries
for(const auto& itr : dynamic_symbol_entries)
{
if(!itr.name.empty() && std::regex_search(itr.name, _re)) return true;
if(!itr.name.empty() && _checker(itr.name)) return true;
}
return false;