Skip to content

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
mainfrom
push-txrswtvqzvxp
Open

mstange wants to merge 5 commits into
mainfrom
push-txrswtvqzvxp

Conversation

@mstange

@mstange mstange commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

I've accidentally committed profile.json.gz files 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.toml on 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.

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.
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