[rocprofv3] Add rocpd output support (part 1: prelude) (#401)
* [rocprofv3] Add rocpd output support (part 1: prelude)
- git submodules for sqlite3, GOTCHA, and pybind11
- HIP stream data
- rocprofiler_query_intercept_table_name(...)
- serialization load
- rocprofiler::sdk::get_perfetto_category(KindT)
- rocprofiler::sdk::parse::strip
- common library updates
- md5sum
- hasher
- simple_timer
- static_tl_object
- get_process_start_time_ns(pid_t)
- output library updates
- node_info
- file_generator (generator is now virtual base class)
- stream info updates
* Added submodules
* Code review updates
* Minor unused-but-set-X warning fixes
* Update CI
- install libsqlite3-dev package
* Update CI
- install libsqlite3-dev package
* Fix static thread-local object memory leak
- also fix signal handler chaining
* Remove URL from comment
* Remove page migration exception
* Enable ROCPROFILER_BUILD_SQLITE3 by default
- try find_package(SQLite3) first and then build when ROCPROFILER_BUILD_SQLITE3=ON
* Fix gotcha installation
- make install of target optional
* Validate tracing + counter collection dispatch data
- i.e. correlation ids, thread ids, timestamps
* Make find_package(SQLite3) optional
- ROCm CI does not have SQLite3 dev package installed and cannot build from source (missing tclsh)
* Fixes to tracing + counter collection test
* get_process_start_time_ns update
- original implementation did not work
* Fix pytest-packages test_perfetto_data for counter collection
- erroneous failure when used with same PMC + multiple agents
* cmake policy: option() honors normal variables
- for GOTCHA submodule
* Improve samples/api_buffered_tracing stability
- reduce likelihood of sporadic exception throw
* Update gotcha submodule
---------
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
[ROCm/rocprofiler-sdk commit: 7166b1ab58]
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
682b9967e0
işleme
b097e276a9
@@ -21,14 +21,21 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "metadata.hpp"
|
||||
#include "agent_info.hpp"
|
||||
#include "host_symbol_info.hpp"
|
||||
#include "kernel_symbol_info.hpp"
|
||||
#include "node_info.hpp"
|
||||
|
||||
#include "lib/att-tool/att_lib_wrapper.hpp"
|
||||
#include "lib/common/environment.hpp"
|
||||
#include "lib/common/filesystem.hpp"
|
||||
#include "lib/common/logging.hpp"
|
||||
#include "lib/common/string_entry.hpp"
|
||||
#include "lib/common/utility.hpp"
|
||||
#include "lib/output/agent_info.hpp"
|
||||
#include "lib/output/host_symbol_info.hpp"
|
||||
#include "lib/output/kernel_symbol_info.hpp"
|
||||
#include "lib/output/node_info.hpp"
|
||||
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
#include <rocprofiler-sdk/rocprofiler.h>
|
||||
@@ -37,6 +44,7 @@
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
@@ -46,9 +54,10 @@ namespace rocprofiler
|
||||
{
|
||||
namespace tool
|
||||
{
|
||||
namespace fs = common::filesystem;
|
||||
namespace
|
||||
{
|
||||
namespace fs = ::rocprofiler::common::filesystem;
|
||||
|
||||
rocprofiler_status_t
|
||||
query_pc_sampling_configuration(const rocprofiler_pc_sampling_configuration_t* configs,
|
||||
long unsigned int num_config,
|
||||
@@ -90,6 +99,8 @@ host_function_info::host_function_info()
|
||||
metadata::metadata(inprocess)
|
||||
: buffer_names{sdk::get_buffer_tracing_names()}
|
||||
, callback_names{sdk::get_callback_tracing_names()}
|
||||
, node_data{read_node_info()}
|
||||
, command_line{common::read_command_line(getpid())}
|
||||
{
|
||||
ROCPROFILER_CHECK(rocprofiler_query_available_agents(
|
||||
ROCPROFILER_AGENT_INFO_VERSION_0,
|
||||
@@ -166,7 +177,7 @@ void metadata::init(inprocess)
|
||||
{
|
||||
auto _info = rocprofiler_counter_info_v1_t{};
|
||||
auto _dim_ids = std::vector<rocprofiler_counter_dimension_id_t>{};
|
||||
auto _dim_info = std::vector<rocprofiler_record_dimension_info_t>{};
|
||||
auto _dim_info = std::vector<rocprofiler_counter_record_dimension_info_t>{};
|
||||
|
||||
ROCPROFILER_CHECK(rocprofiler_query_counter_info(
|
||||
counters[i],
|
||||
@@ -399,12 +410,12 @@ metadata::get_counter_dimension_info() const
|
||||
_ret.emplace_back(ditr);
|
||||
}
|
||||
|
||||
auto _sorter = [](const rocprofiler_record_dimension_info_t& lhs,
|
||||
const rocprofiler_record_dimension_info_t& rhs) {
|
||||
auto _sorter = [](const rocprofiler_counter_record_dimension_info_t& lhs,
|
||||
const rocprofiler_counter_record_dimension_info_t& rhs) {
|
||||
return std::tie(lhs.id, lhs.instance_size) < std::tie(rhs.id, rhs.instance_size);
|
||||
};
|
||||
auto _equiv = [](const rocprofiler_record_dimension_info_t& lhs,
|
||||
const rocprofiler_record_dimension_info_t& rhs) {
|
||||
auto _equiv = [](const rocprofiler_counter_record_dimension_info_t& lhs,
|
||||
const rocprofiler_counter_record_dimension_info_t& rhs) {
|
||||
return std::tie(lhs.id, lhs.instance_size) == std::tie(rhs.id, rhs.instance_size);
|
||||
};
|
||||
|
||||
@@ -495,12 +506,27 @@ metadata::is_runtime_initialized(rocprofiler_runtime_initialization_operation_t
|
||||
runtime_op);
|
||||
}
|
||||
|
||||
void
|
||||
metadata::set_process_id(pid_t _pid, pid_t _ppid, const std::vector<std::string>& _command_line)
|
||||
{
|
||||
process_id = _pid;
|
||||
parent_process_id = _ppid;
|
||||
|
||||
if(!_command_line.empty())
|
||||
command_line = _command_line;
|
||||
else if(_pid == getpid())
|
||||
command_line = common::read_command_line(_pid);
|
||||
|
||||
if(auto _start_ns = common::get_process_start_time_ns(_pid); _start_ns > 0)
|
||||
process_start_ns = _start_ns;
|
||||
}
|
||||
|
||||
std::string_view
|
||||
metadata::get_marker_message(uint64_t corr_id) const
|
||||
{
|
||||
return marker_messages.rlock(
|
||||
[](const auto& _data, uint64_t _corr_id_v) -> std::string_view {
|
||||
return _data.at(_corr_id_v);
|
||||
return (_data.count(_corr_id_v) > 0) ? _data.at(_corr_id_v) : std::string_view{};
|
||||
},
|
||||
corr_id);
|
||||
}
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle