Files
zed/script/collab-flamegraph
Mohamad Khani b9819977a5 logiguard fork v3: full patch set on verified 8c74db0 tree
Includes prior-session patches (carry forward so the app compiles):
  - crates/gpui/build.rs: cross-compile manifest fix
  - crates/gpui/src/platform.rs: PlatformWindow::activate_with_token trait method
  - crates/gpui/src/window.rs: Window::activate_with_token public API
  - crates/gpui_linux/src/linux/wayland/window.rs: WaylandWindow::activate_with_token + activate() keyboard-serial fix

Plus the focus-serial fix:
  - serial.rs: SerialKind::KeyboardEnter
  - client.rs: store wl_keyboard.enter serial; latest_serial_of()

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 01:52:12 +03:30

34 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Notes for fixing this script if it's broken:
# - if you see an error about "can't find perf_6.1" you need to install `linux-perf` from the
# version of Debian that matches the host (e.g. apt-get -t bookworm-backports install linux-perf)
# - if you see an error about `addr2line` you may need to install binutils
set -euo pipefail
source script/lib/deploy-helpers.sh
if [[ $# != 1 ]]; then
echo "Usage: $0 <production|staging>"
exit 1
fi
environment=$1
target_zed_kube_cluster
# 5s in production is ~200Mb..., in staging you probably want to bump this up.
echo "Running perf on collab, collecting 5s of data..."
kubectl -n $environment exec -it deployments/collab -- perf record -p 1 -g -m 64 --call-graph dwarf -- sleep 5
run="collab-$environment-$(date -Iseconds)"
echo "Processing data and downloading to '$run.perf'..."
kubectl -n $environment exec -it deployments/collab -- perf --no-pager script > "$run.perf"
which inferno-flamegraph 2>/dev/null || (echo "installing inferno..."; cargo install inferno)
inferno-collapse-perf "$run.perf" | inferno-flamegraph > "$run.svg"
open "./$run.svg"