Skip to content

Remove tracing from trivial hot functions #435

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

Merged
merged 5 commits into from
Apr 28, 2025

Conversation

ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Apr 25, 2025

When using tracing for profiling purposes, certain uninteresting functions are called over and over, adding overhead specifically when tracing is turned on, rendering the traces useless for profiling purposes. For example, enabling tracing increases the time to create page tables from around 20-40 micro seconds, to over 3 ms (because for example write_u64 is called many times, generating traces for each call). This PR removes some tracing for hot and trivial functions to avoid unnecessary performance hits.

This pr also:

  • Adds a simple example of how to use tracy
  • Renames all tracing-related examples to follow the tracing-* format

PR easiest to review by commits.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Apr 25, 2025
ludfjig added 2 commits April 25, 2025 11:29
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig force-pushed the remove_hot_tracing branch from 5c54f0b to 3d71fdd Compare April 25, 2025 18:29
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig changed the title Remove tracing from hot functions Remove tracing from trivial hot functions Apr 25, 2025
@ludfjig ludfjig marked this pull request as ready for review April 25, 2025 19:04
danbugs
danbugs previously approved these changes Apr 25, 2025
Copy link
Contributor

@danbugs danbugs left a comment

Choose a reason for hiding this comment

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

Long time coming. Great stuff. We should probably at some point establish guidelines to what we want to trace or not.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig enabled auto-merge (squash) April 26, 2025 00:06
@ludfjig ludfjig merged commit 09fd447 into hyperlight-dev:main Apr 28, 2025
29 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants