branchrust_reboot/main/hackweek_serverprofiler_memorycancel
14 Commits over 0 Days - ∞cph!
Update: ServerProfiler - update binary exporter & viewer to handle new Allocs format
- Made ProfileBinViewer's search work with alloc's names
Tests: made a debug export of Craggy in editor, then opened it in the ProfileBinViewer
Clean: ServerProfiler - remove not supported thread sorting keys
Tests: none, trivial change
Update: ServerProfiler - remove the class name and duplicate size into args of a mark
- They are part of the "arguments" view when you click on the allocation mark
- Also assigned all allocations the "A" category so that they can be easily filtered out via queries
Turns out cname (controlling colors) is also unsupported via legacy json import (see issue https://github.com/google/perfetto/issues/208 and linked ones), so if we modify the name, we lose the uniform yellow color for allocations that makes it easier to spot. This also allows to run queries on top of these args more easily.
Tests: exported snasphot from Craggy in editor
Update: ServerProfiler - track and emit allocation class and array size
- using debug binaries (9f4a07f8)
Will need to update binary export and fix the bin viewer tool
Tests: snapshot on craggy in editor
Bugfix: ServerProfiler - properly name worker thread's allocation track
- Another one of the "did it right first time, simplified, now it's borked" cases
Tests: snapshot in editor Craggy
Update: ProfilerExporter.JSON - emit virtual memory graph
Tests: exported on craggy
Optim: ServerProfiler - properly avoid false-sharing when recording memory state when taking a snapshot
- using debug binaries (b445081f)
Should be a smidge faster faster in multithread allocation-busy scenarios.
Tests: took a snapshot on craggy
Update: ServerProfiler - emit working set as KB instead of Bytes
- Also pre-allocate extra size in string builder to account for the memory counters.
KB are easier to spot on the graph changing(not really on perfetto's Values view, better on delta view)
Tests: exported in editor on Craggy
Update: ServerProfiler - vizualize process working set memory
- using debug binaries for now(bc3e74cd)
Need to add virtual set as well and test standalone servers(Win and Linux)
Tests: in editor on craggy.
Bugfix: ProfilerExporter - filter out worker thread marks that are before the frame start
It was originally correct, but in previous commit I simplified the code, thus breaking it. This restores it.
Tests: none, as currently too many changes present in workspace - will test later
Update: ServerProfiler - emit fake "Allocation" threads and duplicate allocation marks there
- Also updated the whole buffer estimation to take into account these metadata marks
- Added support for naming and sorting thread tracks
Well, they do appear, but the thread_sort_index is ignored by perfetto(see https://github.com/google/perfetto/issues/555). Might finally bite the bullet and write a protobuf exporter, but afraid that it'll be more expensive to run and won't compress as well.
Tests: exported a snapshot from editor
Update: ServerProfiler - enable safety checks by default
- Also prefixed error logs to make it easy to identify where it came from
Tests: did 6 exports in editor, no false-positives
Bugfix: ServerProfiler - don't emit thread tracks with only allocations in them
- Handle "legal" case where we don't have any method marks on worker threads after frame start timestamp
- Handle "legal" case where we get a thread profile for a thread that was stopped before the frame start
- Handle "legal" case where we get empty thread profiles due to method filtering
- Dead func removal
This can be a controversial choice, as allocations do happen there, but it's not something we can interact with because there's not enough helpful information about them(for example, what if we filter out entire thread methods?).
Tests: did 4 exports, wasn't able to find weird allocation records on different threads.
Update: ServerProfiler - Track allocations on all threads
The display of this information is still abysmal - need to figure out how to make it better.
Tests: took snapshots both in editor and in standalone server builds (win + linux). Hacked a version that used to crash, but current changes don't anymore.