-
Notifications
You must be signed in to change notification settings - Fork 34
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 3 #59
Open
yoann-heitz
wants to merge
8
commits into
ROCm:rocm-4.3.x
Choose a base branch
from
dorsal-lab:rocm-4.3.x-PR3
base: rocm-4.3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Updated HSA activity flushing function signature in order to have a standard signature for all flushing functions. The function name has been changed and a wrapping data structure has been defined and is now the only one parameter for the new function
As for HSA activity, a new data structure has been defined and the signature updated to conform to other flushing functions signatures. The new datatype is named hip_activity_trace_entry_t. Another similar type (hip_act_trace_entry_t) is already defined to collect HIP activity statistics into a csv file. To avoid confusions, these two types could be merged or the name of one of them could be changed in a future patch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the third pull request for the proposal for a plugin interface for the rocprof command. In this pull request, the signatures of the flushing functions are standardized for every API/kind of event.
The signatures of all flushing functions are now of this kind : void <API>_flush_cb( <API>_trace_entry_t *entry)
Where <API> is the kind of event or API that is traced and <API>_trace_entry_t is a wrapping data structure containing the payloads of the traced events.
Relative to the second pull request, this one starts at commit 77d23b6