Add caching of category region for rocpd (#1420)

* Add caching of category region

Fix vaapi traces

Remove region_with_name

* Applied suggestions from code review
Этот коммит содержится в:
Milan Radosavljevic authored and GitHub committed 2025-10-20 16:05:14 -04:00
1 родитель 4a1a4aa472
Коммит 48fdcebf62
7 files changed
+102 -19

No files matched your search

-2
Просмотреть файл
@@ -96,8 +96,6 @@ buffer_storage::buffer_storage(pid_t _pid)
}
};
ROCPROFSYS_DEBUG("Starting buffered storage flushing thread for pid %d",
static_cast<int>(_pid));
m_created_process = _pid;
std::mutex _shutdown_condition_mutex;
while(m_running)
+6 -6
Просмотреть файл
@@ -279,6 +279,11 @@ rocpd_post_processing::get_region_callback() const
return tokens;
};
if(arg_str.empty())
{
return args;
}
auto tokens = split(arg_str, delimiter);
// Ensure the number of tokens is a multiple of 4
@@ -307,12 +312,7 @@ rocpd_post_processing::get_region_callback() const
auto thread_primary_key =
data_processor.map_thread_id_to_primary_key(_rs.thread_id);
auto callback_tracing_info = m_metadata.get_callback_tracing_info();
auto _name = std::string{ callback_tracing_info.at(
static_cast<rocprofiler_callback_tracing_kind_t>(_rs.kind),
static_cast<rocprofiler_tracing_operation_t>(_rs.operation)) };
auto name_primary_key = data_processor.insert_string(_name.c_str());
auto name_primary_key = data_processor.insert_string(_rs.name.c_str());
auto category_primary_key = data_processor.insert_string(_rs.category.c_str());
size_t stack_id = _rs.correlation_id_internal;
+4 -7
Просмотреть файл
@@ -131,13 +131,12 @@ struct memory_allocate_sample : storage_parsed_type_base
struct region_sample : storage_parsed_type_base
{
region_sample() = default;
region_sample(uint64_t _thread_id, int32_t _kind, int32_t _operation,
region_sample(uint64_t _thread_id, std::string _name,
uint64_t _correlation_id_internal, uint64_t _correlation_id_ancestor,
uint64_t _start_timestamp, uint64_t _end_timestamp,
std::string _call_stack, std::string _args_str, std::string _category)
: thread_id(_thread_id)
, kind(_kind)
, operation(_operation)
, name(std::move(_name))
, correlation_id_internal(_correlation_id_internal)
, correlation_id_ancestor(_correlation_id_ancestor)
, start_timestamp(_start_timestamp)
@@ -147,10 +146,8 @@ struct region_sample : storage_parsed_type_base
, category(std::move(_category))
{}
// Identification fields
uint64_t thread_id;
int32_t kind;
int32_t operation;
uint64_t thread_id;
std::string name;
// Correlation fields
uint64_t correlation_id_internal;
+1 -2
Просмотреть файл
@@ -164,8 +164,7 @@ storage_parser::consume_storage()
case entry_type::region:
{
region_sample _region_sample;
parse_data(sample.data(), _region_sample.thread_id, _region_sample.kind,
_region_sample.operation,
parse_data(sample.data(), _region_sample.thread_id, _region_sample.name,
_region_sample.correlation_id_internal,
_region_sample.correlation_id_ancestor,
_region_sample.start_timestamp, _region_sample.end_timestamp,