rocprofiler-sdk-tool library intermediate binary output (#734)

* Support for binary temporary files

* clang formatting

* formating ring buffer.hpp

* Update source/lib/common/container/ring_buffer.hpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fixing bugs

* fix loop range

* Fix for v3 test failures

* bug fix

* fix bug

* fix memory leaks

* destructing agent_info

* Update CMakeLists.txt

* clang-tidy fixes

* Fix data race on destructor of rocprofiler_agent_t map in rocprofiler-sdk-tool library

* Create lib/rocproifler-sdk-tool/tmp_file.*

- move tmp_file class into separate header/implementation

* Agent Info CSV in rocprofiler-sdk-tool

- update tests to use agent_info.csv instead of rocminfo

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

- use logical_node_id instead of node_id

* Adding stats file

* Adding tests for stats

* Update scratch memory support

- convert scratch memory support to use binary output

* Tool Update: scratch memory stats + extended statistics

- replace generate_*_csv with generate_csv overloads
- added generate_csv for scratch memory
- enable stats for scratch memory
- replace ROCPROF_*_STATS env variables with ROCPROF_STATS env variable

* rocprofv3 update

- simple --stats option
- add scratch memory trace to --sys-trace

* Update tests/rocprofv3/tracing-hip-in-libraries

- extend validate.py to test stats data
- fix conftest.py for memory_copy_stats_data

* Code coverage fixes

- invoke __gcov_dump to ensure that code coverage is flushed after finalization

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ammar ELWazir <ammar.elwazir@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
SrirakshaNag
2024-04-09 05:25:28 -05:00
committed by GitHub
parent 69b8a43dc6
commit bef14ad1b2
24 changed files with 2038 additions and 323 deletions
+7 -5
View File
@@ -92,7 +92,7 @@ struct ring_buffer
/// memory is uninitialized. Typically used by allocators. If Tp is a class type,
/// be sure to use a placement new instead of a memcpy.
template <typename Tp>
Tp* request();
Tp* request(bool wrap = true);
/// Read class-type data from buffer (uses placement new).
template <typename Tp>
@@ -210,11 +210,11 @@ ring_buffer::write(Tp* in, std::enable_if_t<!std::is_class<Tp>::value, int>)
//
template <typename Tp>
Tp*
ring_buffer::request()
ring_buffer::request(bool wrap)
{
if(m_ptr == nullptr) return nullptr;
return request(sizeof(Tp));
return reinterpret_cast<Tp*>(request(sizeof(Tp), wrap));
}
//
template <typename Tp>
@@ -266,7 +266,7 @@ ring_buffer::retrieve() const
{
if(m_ptr == nullptr) return nullptr;
return retrieve(sizeof(Tp));
return reinterpret_cast<Tp*>(retrieve(sizeof(Tp)));
}
//
} // namespace base
@@ -320,7 +320,7 @@ struct ring_buffer : private base::ring_buffer
Tp* read(Tp* _dest) const { return base_type::read<Tp>(_dest).second; }
/// Get an uninitialized address at tail of buffer.
Tp* request() { return base_type::request<Tp>(); }
Tp* request(bool wrap = true) { return base_type::request<Tp>(wrap); }
/// Read data from head of buffer.
Tp* retrieve() { return base_type::retrieve<Tp>(); }
@@ -337,6 +337,8 @@ struct ring_buffer : private base::ring_buffer
/// Returns if the buffer is full.
bool is_full() const { return (base_type::free() < sizeof(Tp)); }
bool clear() { return base_type::clear(); }
template <typename... Args>
auto emplace(Args&&... args)
{