rocprofv3 OTF2 Output Support (#995)

* CMake support for OTF2 library

* Preliminary OTF2 generation implementation

* Completed OTF2 Support

- HSA API
- HIP API
- Marker API
- Async Memory Copies
- Kernel Dispatch

* Update lib/rocprofiler-sdk-tool/generateOTF2.cpp

- fix location type for dispatches

* Testing for OTF2 output

* Add OTF2 to requirements.txt

* Update lib/rocprofiler-sdk-tool/generateOTF2.cpp

- fix getting kernel name

* OTF2 testing with rocprofv3/tracing-hip-in-libraries

* Format external/otf2/CMakeLists.txt

* Update external/otf2/CMakeLists.txt

- guard CMP0135 for cmake < 3.24

* Update lib/rocprofiler-sdk-tool/generateOTF2.cpp

- fix duplicate string ref issue

* Update lib/rocprofiler-sdk-tool/generateOTF2.cpp

- fix header includes

* Update CI workflow

- sudo install pypi requirements for core-rpm for $HOME/.local installs

* Update pytest_utils/otf2_reader.py

- modifications for reading trace

* Update pytest_utils/otf2_reader.py

- misc cleanup

* Update CI workflow

- fix installer artifact naming

* Update pytest_utils/otf2_reader.py

- handle slightly overlapping kernel timestamps for MI300

* OTF2 attributes for category

* Testing with OTF2Reader category attributes

* Fix memory leak in OTF2 generation

- leaking OTF2_AttributeList

[ROCm/rocprofiler-sdk commit: 16d535ef48]
This commit is contained in:
Jonathan R. Madsen
2024-07-30 19:57:19 -05:00
committed by GitHub
vanhempi 21e22a07e8
commit ef22b7a484
27 muutettua tiedostoa jossa 1319 lisäystä ja 138 poistoa
@@ -26,6 +26,7 @@
#include "domain_type.hpp"
#include "generateCSV.hpp"
#include "generateJSON.hpp"
#include "generateOTF2.hpp"
#include "generatePerfetto.hpp"
#include "helper.hpp"
#include "output_file.hpp"
@@ -1249,8 +1250,8 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data)
{
client_finalizer = fini_func;
const uint64_t buffer_size = 32 * common::units::get_page_size();
const uint64_t buffer_watermark = 31 * common::units::get_page_size();
constexpr uint64_t buffer_size = 32 * common::units::KiB;
constexpr uint64_t buffer_watermark = 31 * common::units::KiB;
rocprofiler_get_timestamp(&(stats_timestamp->app_start_time));
@@ -1528,6 +1529,7 @@ tool_fini(void* /*tool_data*/)
rocprofiler_get_timestamp(&(stats_timestamp->app_end_time));
flush();
rocprofiler_stop_context(get_client_ctx());
flush();
@@ -1605,6 +1607,19 @@ tool_fini(void* /*tool_data*/)
&scratch_memory_output.element_data);
}
if(tool::get_config().otf2_output)
{
rocprofiler::tool::write_otf2(tool_functions,
getpid(),
_agents,
&hip_output.element_data,
&hsa_output.element_data,
&kernel_dispatch_output.element_data,
&memory_copy_output.element_data,
&marker_output.element_data,
&scratch_memory_output.element_data);
}
auto destroy_output = [](auto& _buffered_output_v) { _buffered_output_v.destroy(); };
destroy_output(kernel_dispatch_output);