-
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 4 #60
Open
yoann-heitz
wants to merge
15
commits into
ROCm:rocm-4.3.x
Choose a base branch
from
dorsal-lab:rocm-4.3.x-PR4
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.
Definition of roctx_trace_entry_t has been moved to a new header. This new header will contain the definitions of all the <API>_trace_entry_t types used to flush the payloads of the events. The purpose of this modification is to have only one header that needs to be included by developers that want to implement new plugins with the interface proposal. Some fields types of the <API>_trace_entry_t structures are defined either in tool.cpp or in headers lying in /src/core (/src/core/trace_buffer.h). Since trace_buffer.h is removed once ROCTrace has been installed, the definition of these types has been moved to the new header and deleted from the ancient header to avoid redefinition issues.
This modification allows to copy the new header to /opt/rocm/roctracer/include and /opt/rocm/include/roctracer when installing ROCTracer
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 fourth pull request for the proposal for a plugin interface for the rocprof command. In this pull request, the <API>_trace_entry_t structures defined in the previous pull requests have been moved to a new header.
Installation files have been modified to take into account this new header.
Some type definitions declared into headers that are not kept after installation are needed in the new header. To avoid the redeclaration of types, these types were moved from the place where they were first defined to this new header.
Relative to the third pull request, this one starts at commit 3787d72