[SDK] Model Name fix for rocprofiler_lib.agent (#298)
* Model Name fix for rocprofiler_lib.agent
* fixing format
* formatting source
* Adding comments and example
---------
Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
[ROCm/rocprofiler-sdk commit: ae0db8cee5]
Tento commit je obsažen v:
@@ -146,7 +146,20 @@ parse_cpu_info()
|
||||
if(itr.find("vendor_id") == 0)
|
||||
info_v.vendor_id = value.str();
|
||||
else if(itr.find("model name") == 0)
|
||||
info_v.model_name = value.str();
|
||||
{
|
||||
info_v.model_name = value.str();
|
||||
size_t first_colon_pos = match.str().find(':');
|
||||
// This handles the case where the model name has multiple colons
|
||||
// Example "model name : AMD EPYC : 100-000000248"
|
||||
if(first_colon_pos != std::string::npos)
|
||||
{
|
||||
// Extract the model name after the first colon
|
||||
info_v.model_name = match.str().substr(first_colon_pos + 1);
|
||||
// Remove leading and trailing whitespaces
|
||||
info_v.model_name = std::regex_replace(
|
||||
info_v.model_name, std::regex("^\\s+|\\s+$"), "");
|
||||
}
|
||||
}
|
||||
else if(itr.find("processor") == 0)
|
||||
info_v.processor = std::stol(value.str());
|
||||
else if(itr.find("cpu family") == 0)
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele