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

perf: Use /tmp/gprofiler/perf-buildids as the buildid cache for perf #17

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

Jongy
Copy link
Contributor

@Jongy Jongy commented Apr 8, 2021

Description

Avoid cluttering other parts of the filesystem (by default, it uses /root/.debug).
When gprofiler runs as a container, it doesn't really matter (both /root/ and /tmp
are just part of the container filesystem).
But we plan to allow running gprofiler as an executable, and in that case, we
should keep our files in /tmp/gprofiler.

Motivation and Context

Keep our files in /tmp/gprofiler.

How Has This Been Tested?

I ran the gprofiler container with this fix and verified that /root/.debug is not used anymore, and that all cached DSOs go to /tmp/gprofiler/....

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have updated the relevant documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Avoid cluttering other parts of the filesystem (by default, it uses /root/.debug).
When gprofiler runs as a container, it doesn't really matter (both /root/ and /tmp
are just part of the container filesystem).
But we plan to allow running gprofiler as an executable, and in that case, we
should keep our files in /tmp/gprofiler.
@Jongy Jongy added the enhancement New feature or request label Apr 8, 2021
@Jongy Jongy requested a review from DanielShaulov April 8, 2021 08:31
@Jongy Jongy merged commit cbc04d2 into master Apr 8, 2021
@Jongy Jongy deleted the perf-buildid-dir-in-tmp branch April 8, 2021 09:11
Jongy added a commit that referenced this pull request Jul 15, 2021
buildid recording & cache is enabled by default in perf, but disabled in
"switch output" mode (see explanation in Linux commit 0c1d46a8796e830).
We had it enabled (and specifically handled it in #17) because I had in mind that
it's required for perf to properly resolve symbols across namespaces.
I have proved this incorrect by testing, so there's no reason to keep these
flags on - we run "script" right after record is done, it's okay to access
files just by path.
Jongy added a commit that referenced this pull request Jul 18, 2021
* perf: Run perf in continuous mode, utilizing --switch-output.

This is done for 2 reasons:
1. More correct & accurate: collect samples *all* the time, without excluding any interval.
2. For performance reasons - no overhead of starting/stopping perf.

* Remove profiling interval, it makes no sense to maintain it with perf running in continuous mode.

* perf: Remove disk check

I don't see why it's needed *here*. We can add such a check in the main file.
But I don't think it's needed now.

* perf: Don't use buildid recording & cache 

buildid recording & cache is enabled by default in perf, but disabled in
"switch output" mode (see explanation in Linux commit 0c1d46a8796e830).
We had it enabled (and specifically handled it in #17) because I had in mind that
it's required for perf to properly resolve symbols across namespaces.
I have proved this incorrect by testing, so there's no reason to keep these
flags on - we run "script" right after record is done, it's okay to access
files just by path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants