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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user