Contexts update + buffer flushing + cleanup (#338)

* Update lib/rocprofiler-sdk/context/context.*

- get_registered_contexts functions (local copy)

* Update lib/rocprofiler-sdk/hsa/{queue,queue_controller}.cpp

- remove ROCPROFILER_BUFFER_TRACING_MEMORY_COPY code

* Update tests/kernel-tracing/kernel-tracing.cpp

- move stop() and flush() in tool_fini to before reporting of sizes of data collected

* Update lib/rocprofiler-sdk/hsa/hsa.*

- remove stale set_callback / activity_functor_t code

* Update lib/rocprofiler-sdk/buffer.cpp

- full wait instead of returning busy when buffer is busy
- use task_group::join instead of task_group::wait to fully wait for tasks to finish (bug fix)

* Update lib/rocprofiler-sdk/agent.cpp

- support agent mapping for CPU agents

* Remove direct access to vector of registered contexts
Этот коммит содержится в:
Jonathan R. Madsen
2024-01-03 04:26:46 -06:00
коммит произвёл GitHub
родитель c5e45803e9
Коммит 199f0b5421
15 изменённых файлов: 168 добавлений и 168 удалений
+10 -2
Просмотреть файл
@@ -144,7 +144,15 @@ flush(rocprofiler_buffer_id_t buffer_id, bool wait)
if(wait && task_group) task_group->wait();
// buffer is currently being flushed or destroyed
if(buff->syncer.test_and_set()) return ROCPROFILER_STATUS_ERROR_BUFFER_BUSY;
if(buff->syncer.test_and_set())
{
if(!wait) return ROCPROFILER_STATUS_ERROR_BUFFER_BUSY;
while(buff->syncer.test_and_set())
{
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::milliseconds{10});
}
}
auto idx = buff->buffer_idx++;
@@ -187,7 +195,7 @@ flush(rocprofiler_buffer_id_t buffer_id, bool wait)
if(task_group)
{
task_group->exec(_task);
if(wait) task_group->wait();
if(wait) task_group->join();
}
else
{