mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-28 13:33:44 +08:00
56b9025e3d
version: sunnypilot v2026.003.000 (staging) date: 2026-09-01T06:00:28 master commit: 51987a62d07c44cc9e14b4d85dcb445edecd17d3
22 lines
431 B
Bash
Executable File
22 lines
431 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
# find process with name passed in (excluding this process)
|
|
for PID in $(pgrep -f $1); do
|
|
if [ "$PID" != "$$" ]; then
|
|
ps -p $PID -o args
|
|
TRACE_PID=$PID
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -z "$TRACE_PID" ]; then
|
|
echo "could not find PID for $1"
|
|
exit 1
|
|
fi
|
|
|
|
sudo env PATH=$PATH py-spy record -d 5 -o /tmp/perf$TRACE_PID.svg -p $TRACE_PID &&
|
|
google-chrome /tmp/perf$TRACE_PID.svg
|