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

Add support for profiling hooks on CPU. #199

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

krenzland
Copy link

This PR adds the capability of profiling individual queries on CPU without prescribing the used profiling tools.
The workflow is very simple.
The user provides a --profiling-hook [executable] argument to nds_power.py. executable here is a script that gets called before and after each query. When the query starts, the first argument is start, when it stops, the first argument is stop.

For example, a user can decide to start perf, attach a profiler, etc.

This adds the capability of profiling individual queries
on CPU without prescribing the used profiling tools.

Signed-off-by: Lukas Krenz <lkrenz@nvidia.com>
Signed-off-by: Lukas Krenz <lkrenz@nvidia.com>
nds/nds_power.py Outdated

def __call__(self, query_name):
self.query_name = query_name
self.output_directory = os.path.join(self.output_root, query_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pass the output_root and query_name to the hook and let it decide how it wants to store (or IF it wants to store) in the file system. So the hook would need to mkdir in this case. Thoughts?

Script now can choose how to organize profiling.

Signed-off-by: Lukas Krenz <lkrenz@nvidia.com>
@krenzland
Copy link
Author

Thanks for the review @abellina, I've followed your suggestion. Is there anything else that I could improve?

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.

2 participants