Store profiles in a per-user directory rather than in the current directory, and add a config file - #887
Open
mstange wants to merge 5 commits into
Open
Store profiles in a per-user directory rather than in the current directory, and add a config file#887mstange wants to merge 5 commits into
mstange wants to merge 5 commits into
Conversation
The sort key for deletion candidates converted the file size to i32, which panics for large files. Sort by Reverse(size) instead.
Files which were accessed within the minimum age are never deleted, not even to enforce the size limit. This protects files which were just written, and files which a concurrent process is still using.
…ync. Previously, run_server_serving_profile and get_presymbolicate_info each created their own runtime. Now each action creates a single runtime up front and uses block_on for the async parts. This is a prerequisite for opening the profile store (whose QuotaManager spawns a task) before recording starts, and for a future daemon which already runs inside a runtime.
The TOML file lives at ~/.config/samply/config.toml, or %APPDATA%\samply\config.toml on Windows, and can be overridden with --config or the SAMPLY_CONFIG environment variable. A commented template is written on first run; on Windows, it enables the Microsoft symbol server. Command line symbol arguments are layered on top of the config. The symbol cache limits, previously fixed at 10 GB and 2 weeks, are now configurable, and a new minimum age (default one day) keeps recently used symbol files from being deleted at startup.
samply record and samply import no longer write profile.jslb.gz into the current directory. The profile goes to ~/.local/share/samply/profiles (%LOCALAPPDATA%\samply\profiles on Windows) under a timestamped name, and the path is printed. An explicit -o path bypasses the store. The store is managed by a QuotaManager with settings from the new [profiles] config section: by default, profiles which haven't been opened for 30 days are deleted, the store is kept under 5 GB, and profiles created or opened within the last day are never deleted. samply load marks stored profiles as recently used. On Windows, the ETL files still sit next to the profile; with --keep-etl they are registered with the store so that they are evicted too.
This file contains hidden or 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
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.
I've accidentally committed
profile.json.gzfiles to source (usually with jj) more times than I like. It's time to change the default location of were profile files are stored.These changes make it so that they're stored at
~/.local/share/samply/profiles/(%LOCALAPPDATA%\samply\profiles\on Windows).Additionally, these changes are adding a config file at
~/.config/samply/config.toml(%APPDATA%\samply\config.tomlon Windows) so that you can configure how long to keep the recorded profiles around. We default to two weeks.And while we're at it, the config file also lets you configure symbol servers. And it makes it so that, on Windows, the Microsoft symbol server is used by default.