Skip to content

Conversation

@Fang-
Copy link
Collaborator

@Fang- Fang- commented Jul 9, 2024

Whenever we run under the profiling flag (-P --profile), we now collect sampling traces into .urb/put/trace/dump.txt.

We take care to format the output in a way that's compatible with flamegraph tooling. Specifically, we avoid writing into the first couple lines of the file, and suffix every trace with a counter (always 1), to mimic dtrace output.

(See also brendangregg/FlameGraph.)

We have not yet cleaned up old code in u3t_samp.


After running some ship with --profile, we can use the flamegraph scripts to turn the dump into an svg:

./stackcollapse.pl ~/piers/some-ship/.urb/put/trace/dump.txt | ./flamegraph.pl > dump.svg

If the ship ran -build-file %/sys/hoon/hoon under the profiler, the resulting svg might look something like this:

image

Whenever we run under the profiling flag, we now collect sampling traces
into .urb/put/trace/dump.txt.

We take care to format the output in a way that's compatible with
flamegraph tooling. Specifically, we avoid writing into the first couple
lines of the file, and suffix every trace with a counter (always 1).

(See also brendangregg/FlameGraph.)

We have not yet cleaned up old code in u3t_samp.

Co-authored-by: joemfb <joemfb@gmail.com>
@tacryt-socryp
Copy link
Contributor

This is sick, love it.

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.

3 participants