Updates/fixes for CI, docs, tests, samples, and common library (#528)

- .github/workflows/continuous_integration.yml
  - apt-get update before apt-get install
  - remove libgtest-dev
  - actions-comment-pull-request: v2.4.3 -> v2.5.0
- .github/workflows/formatting.yml
  - create-pull-request: v5 -> v6
- cmake/rocprofiler_options.cmake
  - remove unused ROCPROFILER_DEBUG_TRACE and ROCPROFILER_LD_AQLPROFILE options
- samples/counter_collection/callback_client.cpp
  - corr_id field renamed to correlation_id
- samples/counter_collection/client.cpp
  - corr_id field renamed to correlation_id
- include/rocprofiler-sdk/fwd.h
  - In rocprofiler_record_counter_t: rename corr_id field to correlation_id
  - doxygen fixes
- lib/common/utility.*
  - remove get_accurate_clock_id_impl
  - timestamp_ns() defaults to CLOCK_BOOTTIME
- lib/rocprofiler-sdk/counters/core.cpp
  - fix spelling mistake: extrenal -> external
  - corr_id field renamed to correlation_id
- lib/rocprofiler-sdk-tool/tool.cpp
  - fix destruction of static tool::output_file before finalization
- scripts/update-docs.sh
  - define PROJECT_NAME
- tests/async-copy-tracing/validate.py
  - init_time and fini_time checks
  - hip_api_traces, marker_api_tracing
- tests/common/serialization.hpp
  - fix save function for rocprofiler_record_counter_t following rename of corr_id to correlation_id
- tests/kernel-tracing/validate.py
  - init_time and fini_time checks
  - relax test_total_runtime range
- tests/rocprofv3/tracing/CMakeLists.txt
  - remove -M from rocprofv3-test-systrace-execute
  - exclude test_hsa_api_trace in rocprofv3-test-systrace-validate due to HIP API tracing
- tests/rocprofv3/tracing/validate.py
  - update test_kernel_trace to accept mangled or demangled
- tests/tools/json-tool.cpp
  - remove use of GLOG
  - include init_time and fini_time
  - write_json(...) function
Esse commit está contido em:
Jonathan R. Madsen
2024-02-22 00:16:43 -06:00
commit de GitHub
commit 0d939edbba
17 arquivos alterados com 292 adições e 233 exclusões
+32 -8
Ver Arquivo
@@ -43,8 +43,6 @@
#include <rocprofiler-sdk/registration.h>
#include <rocprofiler-sdk/rocprofiler.h>
#include <glog/logging.h>
#include <unistd.h>
#include <atomic>
#include <cassert>
@@ -432,7 +430,7 @@ dispatch_callback(rocprofiler_queue_id_t, /*queue_id*/
// Counters we want to collect (here its SQ_WAVES_sum)
auto* counters_env = getenv("ROCPROF_COUNTERS");
if(std::string(counters_env) != "SQ_WAVES_sum")
LOG(FATAL) << "Counter not supported in the test tool";
throw std::runtime_error{"Counter not supported in the test tool"};
std::set<std::string> counters_to_collect = {"SQ_WAVES_sum"};
// GPU Counter IDs
@@ -728,9 +726,16 @@ auto buffers = std::array<rocprofiler_buffer_id_t*, 6>{&hsa_api_buffered_buffer,
auto agents = std::vector<rocprofiler_agent_t>{};
rocprofiler_timestamp_t init_time = 0;
rocprofiler_timestamp_t fini_time = 0;
rocprofiler_thread_id_t main_tid = 0;
int
tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data)
{
rocprofiler_get_timestamp(&init_time);
rocprofiler_get_thread_id(&main_tid);
assert(tool_data != nullptr);
rocprofiler_available_agents_cb_t iterate_cb =
@@ -997,6 +1002,9 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data)
return 0;
}
void
write_json(call_stack_t* _call_stack);
void
tool_fini(void* tool_data)
{
@@ -1006,6 +1014,8 @@ tool_fini(void* tool_data)
stop();
flush();
rocprofiler_get_timestamp(&fini_time);
std::cerr << "[" << getpid() << "][" << __FUNCTION__
<< "] Finalizing... agents=" << agents.size()
<< ", code_object_callback_records=" << code_object_records.size()
@@ -1027,6 +1037,17 @@ tool_fini(void* tool_data)
_call_stack->emplace_back(source_location{__FUNCTION__, __FILE__, __LINE__, ""});
}
write_json(_call_stack);
std::cerr << "[" << getpid() << "][" << __FUNCTION__ << "] Finalization complete.\n"
<< std::flush;
delete _call_stack;
}
void
write_json(call_stack_t* _call_stack)
{
auto ofname = std::string{"rocprofiler-tool-results.json"};
if(auto* eofname = getenv("ROCPROFILER_TOOL_OUTPUT_FILE")) ofname = eofname;
@@ -1068,6 +1089,14 @@ tool_fini(void* tool_data)
json_ar.setNextName("rocprofiler-sdk-json-tool");
json_ar.startNode();
json_ar.setNextName("metadata");
json_ar.startNode();
json_ar(cereal::make_nvp("pid", getpid()));
json_ar(cereal::make_nvp("main_tid", main_tid));
json_ar(cereal::make_nvp("init_time", init_time));
json_ar(cereal::make_nvp("fini_time", fini_time));
json_ar.finishNode();
json_ar(cereal::make_nvp("agents", agents));
if(_call_stack) json_ar(cereal::make_nvp("call_stack", *_call_stack));
@@ -1114,11 +1143,6 @@ tool_fini(void* tool_data)
*ofs << std::flush;
if(cleanup) cleanup(ofs);
std::cerr << "[" << getpid() << "][" << __FUNCTION__ << "] Finalization complete.\n"
<< std::flush;
delete _call_stack;
}
void