[rocprofiler-systems] Add cached demangler and replace old demangle (#2135)
* Add cached demangler and replace old * Add unit tests * Applied suggestions from code review * Applied suggestions from code review
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
21afa807a9
Коммит
666e76deac
+21
-18
@@ -28,6 +28,7 @@
|
||||
#include "core/config.hpp"
|
||||
#include "core/containers/stable_vector.hpp"
|
||||
#include "core/debug.hpp"
|
||||
#include "core/demangler.hpp"
|
||||
#include "core/gpu.hpp"
|
||||
#include "core/perfetto.hpp"
|
||||
#include "core/state.hpp"
|
||||
@@ -335,8 +336,9 @@ iterate_args_callback(rocprofiler_callback_tracing_kind_t /*kind*/, int32_t /*op
|
||||
{
|
||||
auto* _data = static_cast<function_args_t*>(data);
|
||||
if(arg_type && arg_name && arg_value_str)
|
||||
_data->emplace_back(
|
||||
argument_info{ arg_number, demangle(arg_type), arg_name, arg_value_str });
|
||||
_data->emplace_back(argument_info{ arg_number,
|
||||
rocprofsys::utility::demangle(arg_type),
|
||||
arg_name, arg_value_str });
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -388,8 +390,8 @@ get_backtrace(std::optional<std::vector<tim::unwind::processed_entry>>& _bt_data
|
||||
(_linfo && _linfo.line > 0)
|
||||
? join("", _linfo.line)
|
||||
: ((itr.lineno == 0) ? std::string{ "?" } : join("", itr.lineno));
|
||||
auto _entry = join("", demangle(*_func), " @ ",
|
||||
join(':', ::basename(_loc->c_str()), _line));
|
||||
auto _entry = join("", rocprofsys::utility::demangle(*_func), " @ ",
|
||||
join(':', ::basename(_loc->c_str()), _line));
|
||||
backtrace[join("", "frame#", _bt_cnt++)] = _entry;
|
||||
}
|
||||
}
|
||||
@@ -771,7 +773,7 @@ tool_tracing_callback_stop(
|
||||
: ((itr.lineno == 0) ? std::string{ "?" }
|
||||
: join("", itr.lineno));
|
||||
auto _entry =
|
||||
join("", demangle(*_func), " @ ",
|
||||
join("", rocprofsys::utility::demangle(*_func), " @ ",
|
||||
join(':', ::basename(_loc->c_str()), _line));
|
||||
if(_bt_cnt < 10)
|
||||
{
|
||||
@@ -1139,12 +1141,13 @@ ompt_tracing_callback_stop(
|
||||
(_linfo && !_linfo.location.empty())
|
||||
? &_linfo.location
|
||||
: ((itr.location.empty()) ? &_unk : &itr.location);
|
||||
auto _line = (_linfo && _linfo.line > 0)
|
||||
? join("", _linfo.line)
|
||||
: ((itr.lineno == 0) ? std::string{ "?" }
|
||||
: join("", itr.lineno));
|
||||
auto _entry = join("", demangle(*_func), " @ ",
|
||||
join(':', ::basename(_loc->c_str()), _line));
|
||||
auto _line = (_linfo && _linfo.line > 0)
|
||||
? join("", _linfo.line)
|
||||
: ((itr.lineno == 0) ? std::string{ "?" }
|
||||
: join("", itr.lineno));
|
||||
auto _entry =
|
||||
join("", rocprofsys::utility::demangle(*_func), " @ ",
|
||||
join(':', ::basename(_loc->c_str()), _line));
|
||||
if(_bt_cnt < 10)
|
||||
{
|
||||
// Prepend zero for better ordering in UI. Only one zero
|
||||
@@ -1570,13 +1573,13 @@ tool_tracing_buffered(rocprofiler_context_id_t /*context*/,
|
||||
const auto* _kern_sym_data =
|
||||
get_kernel_symbol_info(record->dispatch_info.kernel_id);
|
||||
|
||||
auto _name = tim::demangle(_kern_sym_data->kernel_name);
|
||||
auto _stack_id = record->correlation_id.internal;
|
||||
auto _beg_ns = record->start_timestamp;
|
||||
auto _end_ns = record->end_timestamp;
|
||||
auto _agent_id = record->dispatch_info.agent_id;
|
||||
auto _queue_id = record->dispatch_info.queue_id;
|
||||
const auto* _agent = tool_data->get_gpu_tool_agent(_agent_id);
|
||||
auto _name = rocprofsys::utility::demangle(_kern_sym_data->kernel_name);
|
||||
auto _stack_id = record->correlation_id.internal;
|
||||
auto _beg_ns = record->start_timestamp;
|
||||
auto _end_ns = record->end_timestamp;
|
||||
auto _agent_id = record->dispatch_info.agent_id;
|
||||
auto _queue_id = record->dispatch_info.queue_id;
|
||||
const auto* _agent = tool_data->get_gpu_tool_agent(_agent_id);
|
||||
|
||||
uint64_t _stream_id = get_stream_id(record).handle;
|
||||
if(_stream_id == 0)
|
||||
|
||||
Ссылка в новой задаче
Block a user