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 1 #57

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

Conversation

yoann-heitz
Copy link

This is the first pull request for the proposal for a plugin interface for the rocprof command. It fixes an issue that made the fine-grained control unusable and adds a buffer mechanism when tracing KFD API, as for HSA and HIP APIs.

Warning :
When using fine-grained control, only some functions (those specified by the user) will be traced. It may lead to crashes at the post-processing step (conversion from text to JSON/SQLITE) since the conversion scripts require data from the payloads of events triggered by specific functions and users may disable the callbacks for these functions. However, the text files obtained with the -d option will not be corrupted and contain only the events specified by the user

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.
@yoann-heitz yoann-heitz changed the title Interface proposal : pull-request 1 Interface proposal : pull request 1 Sep 21, 2021
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