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

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

Conversation

yoann-heitz
Copy link

This is the last pull request for the interface proposal. It adds the --output-plugin option in rocprof and instructions to overload user-defined flushing functions (that respect some specifications).

An example of a CTF plugin can be found here : https://github.com/dorsal-lab/rocprofiler_ctf_plugin/tree/rocm-4.3.x-PR5 (be sure to use the rocm-4.3.x-PR5 branch for tests).

Relative to the fourth pull request, this one starts at commit 86d43f3

Deleted a line that makes rocprof abort when using fine grained control one several APIs at a time. The parsing function in libtracer_tool.so that parses the input XML file that specifies the functions for which the user wants to activate the tracing callbacks seems to handle correctly cases where fine-grained control is used on several APIs. This line can be safely deleted.
Isolated flushing instructions into a wrapping function. The file descriptor used for flushing is the one that is globally defined and not the one stored in the context_entry_t object as it is always the one that is defined globally that is used. If using a globally defined file descriptor is problematic (however it is the norm in the libtracer_tool.so library in ROCTracer) rather than passing it through arguments, the wrapping flushing function can be modified to take a void pointer. The file descriptor can then be passed through this pointer and be used in the default flushing function.
Isolated flushing instructions into a wrapping function. The file descriptor used for flushing is the one that is globally defined and not the one stored in the context_entry_t object as it is always the one that is defined globally that is used. If using a globally defined file descriptor is problematic (however it is the norm in the libtracer_tool.so library in ROCTracer) rather than passing it through arguments, the wrapping flushing function can be modified to take a void pointer. The file descriptor can then be passed through this pointer and be used in the default flushing function.
The signature of the function that flush metrics has been updated in order to have a standard signature for all the flushing functions. A new data structure that is passed as the only one argument for the function has also been defined
As for the metrics, the kernel flushing function signature has been updated and a new data structure has been defined
Definition of metric_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.
Added the new header in list of headers. It will allow the new header to be copied to /opt/rocm/include/rocprofiler and /opt/rocm/rocprofiler/include when installing rocprofiler
Added the option to load plugins in rpl_run.sh. When this option is used with the plugin directory as parameter, the existence of the directory and of the libraries inside it are checked. If they all exist then an environment variable that will be used to know that a plugin is used is exported. Two other environment variables are also exported, they specify the paths to the .so libraries inside the plugin directory.
This update allows to export the path to the directory of the plugin since some plugins may need some files of the directory and require to know its path
Defined a function pointer that references the default flushing function if no plugin is used. If a plugin is used, the function defined in the plugin library will be loaded to this pointer
Same modifications as for metrics. Also the original text file is not created and opened anymore when a plugin is used
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