Add support to use the field name in rdci

In the rdci dmon and fieldgroup, now the fields can be specified
using either number id or the field name.

When the rdc is async fetching metrics, it will not report that fetch
as an error.

Change-Id: I81331e2c239af987181147be5ac0e29ba1617ab4


[ROCm/rdc commit: d30cb81fdb]
Este cometimento está contido em:
Bill(Shuzhou) Liu criou e Chris Freehill cometeu 2020-08-17 14:07:25 -05:00
1 ascendente aa0a40f84d
cometimento 0f8f345992
6 ficheiros modificados
+60 -12

Não existem ficheiros que correspondam à sua pesquisa

+8 -3
Ver ficheiro
@@ -147,10 +147,15 @@ void RdciDmonSubSystem::parse_cmd_opts(int argc, char ** argv) {
std::vector<std::string> vec_ids = split_string(field_ids, ',');
for (uint32_t i = 0; i < vec_ids.size(); i++) {
if (!IsNumber(vec_ids[i])) {
throw RdcException(RDC_ST_BAD_PARAMETER, "The field Id "
+vec_ids[i]+" needs to be a number");
uint32_t field_id = 0;
if (!get_field_id_from_name(vec_ids[i], field_id)) {
throw RdcException(RDC_ST_BAD_PARAMETER,
"The field name "+vec_ids[i]+" is not valid");
}
field_ids_.push_back(field_id);
} else {
field_ids_.push_back(std::stoi(vec_ids[i]));
}
field_ids_.push_back(std::stoi(vec_ids[i]));
}
}
}