PC Sampling API: emit info logs instead of error (#53)

* PC Sampling API: emit info logs instead of error

Inside PC sampling API, emit info logs instead of
error logs. The tests verifies status code of each
API call and decide when to skip, instead of relying
on messages in logs.

The samples_processing.cpp test has been removed as it's
not used.
This commit is contained in:
Indic, Vladimir
2024-12-06 20:40:30 +01:00
committed by GitHub
szülő bd447ab941
commit b4d7ee7887
6 fájl változott, egészen pontosan 25 új sor hozzáadva és 446 régi sor törölve
@@ -219,9 +219,20 @@ TEST(pc_sampling, query_configs_agent_does_not_exists)
{
int cb_data = USER_DATA_VAL;
// The agent does not exists
EXPECT_EQ(rocprofiler_query_pc_sampling_agent_configurations(
rocprofiler_agent_id_t{.handle = 0xDEADBEEF}, check_all_configs_cb, &cb_data),
ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND);
auto status = rocprofiler_query_pc_sampling_agent_configurations(
rocprofiler_agent_id_t{.handle = 0xDEADBEEF}, check_all_configs_cb, &cb_data);
std::set<rocprofiler_status_t> reasons_to_skip_test = {
ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED,
ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE,
ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_KERNEL};
// emit the error to skip a test
if(reasons_to_skip_test.count(status) > 0) ROCP_ERROR << "PC sampling unavailable";
// If PC sampling API is enabled, and this system supports this feature,
// then assert the agent with id `0xDEADBEEF` does not exist.
EXPECT_EQ(status, ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND);
}
TEST(pc_sampling, query_configs_after_service_setup)