Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface proposal : pull request 2 #58

Open
wants to merge 6 commits into
base: rocm-4.3.x
Choose a base branch
from

Conversation

yoann-heitz
Copy link

This is the second pull request for the proposal for a plugin interface for the rocprof command. In this pull request, flushing instructions are isolated in wrapping functions

Relative to the first pull request, this one starts at commit a669e4a

Replaced all C++ standard vectors with C arrays in functions used to enable fine-grained control. These vectors appeared to be empty at the moment when roctracer_enable_op_callback is called in OnLoad function. This may be due to the fact that this function is called by another .so or DLL library and exchanging STL objects (like C++ vectors) through these kinds of libraries can lead to unexpected behavior when the libraries were not compiled with the same compiler and compiler version. The use of C native objects can solve these issues.
Added a ring buffer to trace KFD API and separated lines of code dedicated to flushing into text from lines of code dedicated to collecting events data for KFD API. Added a new structure to store KFD events data into the newly added buffer. This commit aims for rocprof to have the same behavior when tracing KFD API as when tracing HSA or HIP APIs.
In some cases (if ROCTX_CLOCK_TIME is defined), the timestamp of the rocTX event must be processed before flushing the data. This commit aims to separate the computation of the timestamp from the flushing part : a wrapping function is defined to do it and the roctx_flush_cb function only contains operation on C++ string streams and flushing instructions
Index incrementation was initially done inside HSA activity flushing function. Separated the flushing instructions from the index incrementation with a wrapping function. The pid is also given as a parameter to the flushing function.
When collecting statistics about HIP API, the initial flushing function also fills an EvtStats structure. With this commit, flushing instruction are wrapped into another function that is called after this structure is filled if needed. The flushing function only contains flushing instructions in this commit.
Instructions for flushing HIP activities informations into hcc_ops_trace.txt have been put into a wrapping function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant