Fix hardware counter summary files not being generated after profiling (#124)

- Register a cleanup function in tim::manager instance to write out data in
counter storages

- The counter_storage::write() calls in tool_fini happen after the storage is destroyed
which is too late for the write to happen.

- Adjust traits for counter_data_tracker

- Add MIN, MAX, VAR, STDDEV columns
- Remove DEPTH, UNITS, %SELF columns

- Update "add_validation_test" to test for the existence of output file(s).
- Added step to test perfetto output for `transpose-rocprofiler-sampling`
and `transpose-rocprofiler-binary-rewrite`

---------

Co-authored-by: David Galiffi <David.Galiffi@amd.com>
This commit is contained in:
Sohaib Nadeem
2025-03-05 16:05:18 -05:00
committed by GitHub
parent c3138e1962
commit 42922ec851
6 changed files with 46 additions and 24 deletions
@@ -1179,22 +1179,6 @@ tool_fini(void* callback_data)
if(get_counter_storage())
{
auto _storages = std::vector<const counter_storage*>{};
for(const auto& citr : *get_counter_storage())
{
for(const auto& itr : citr.second)
_storages.emplace_back(&itr.second);
}
std::sort(_storages.begin(), _storages.end(),
[](const counter_storage* lhs, const counter_storage* rhs) {
return *lhs < *rhs;
});
for(const auto* itr : _storages)
itr->write();
_storages.clear();
get_counter_storage()->clear();
delete get_counter_storage();
get_counter_storage() = nullptr;