Skip to content

Commit

Permalink
Merge pull request #863 from ROCm/json-results-log
Browse files Browse the repository at this point in the history
make logs as results instead of info
  • Loading branch information
manoj-freyr authored Dec 12, 2024
2 parents 4b7ec6f + bcb279a commit faaaf2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mem.so/src/rvs_memworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void MemWorker::run_tests(char* ptr, unsigned int tot_num_blocks)
std::string tname{rvs_memtests[i].desc};
tname = tname.substr(tname.find('[')+1, tname.find(']') - tname.find('[')-1);
std::string passed = err == 0 ? "true" : "false";
log_to_json(rvs::loginfo, "Test", tname, "Time Taken", tdiff_str, "errors",std::to_string(err), "pass", passed);
log_to_json(rvs::logresults, "Test", tname, "Time Taken", tdiff_str, "errors",std::to_string(err), "pass", passed);
}
}//for

Expand Down Expand Up @@ -207,7 +207,7 @@ void MemWorker::run() {
std::to_string(gpu_id));
rvs::lp::AddString(json_node,"Total Memory", std::to_string(total));
rvs::lp::AddString(json_node,"Free Memory", std::to_string(free));
rvs::lp::LogRecordFlush(json_node, rvs::loginfo);
rvs::lp::LogRecordFlush(json_node, rvs::logresults);
}
}
allocate_small_mem();
Expand Down
12 changes: 8 additions & 4 deletions rcqt.so/src/packageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ void PackageHandler::validatePackages(){
std::string cumulate_deps;
for (const auto& val: pkgmap){
++totalPackages;
auto pkname = val.first.find(ORDEP) == std::string::npos ? val.first : val.first.substr(ORDEP.size());
void *pkg_node = json_node_create( module_name, m_metapkg, rvs::loginfo);
if (pkg_node){
rvs::lp::AddString(pkg_node, "depname", val.first);
if (val.first.find(ORDEP) != std::string::npos)

rvs::lp::AddString(pkg_node, "depname", pkname);
rvs::lp::AddString(pkg_node, "expected", val.second);
}
auto inputname = val.first;
Expand All @@ -111,8 +114,9 @@ void PackageHandler::validatePackages(){
inputname = inputname.substr(ORDEP.size()); // Remove ordep identifier
std::cout << "Package " << inputname << " installed version is " <<
installedvers << std::endl;
//rvs::lp::AddString(pkg_node, "installed",installedvers);
}
rvs::lp::AddString(pkg_node, "installed", "N/A");
rvs::lp::AddString(pkg_node, "installed", installedvers);
rvs::lp::AddNode(json_node, pkg_node);

}
Expand All @@ -133,7 +137,7 @@ void PackageHandler::validatePackages(){
rvs::lp::AddString(res_node, "Mismatched Packages", std::to_string(badVersions));
rvs::lp::AddString(res_node, "pass", totalPackages == installedPackages ? "true" : "false");
rvs::lp::AddNode(json_node, res_node);
rvs::lp::LogRecordFlush(json_node, rvs::loginfo);
rvs::lp::LogRecordFlush(json_node, rvs::logresults);

if(nullptr != callback) {
rvs::action_result_t action_result;
Expand Down Expand Up @@ -186,7 +190,7 @@ void PackageHandler::listPackageVersion(){
msg += "\tInstalled packages : " + std::to_string(installedPackages) + "\n";

std::cout << msg;
log_to_json(rvs::loginfo, kv_pairs);
log_to_json(rvs::logresults, kv_pairs);

if(nullptr != callback) {
rvs::action_result_t action_result;
Expand Down

0 comments on commit faaaf2e

Please sign in to comment.