mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
profiling: replace pyflame with py-spy (#22864)
* py-spy
* remove pyflame
* find process by name
old-commit-hash: caad4919ac
This commit is contained in:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/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
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:157ca425c4ea68345b5d44356c6fd65d0e32a006e5a0e770c75c7d136dbd0c4c
|
||||
size 174
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7eb044134b9c9fae6152fe8c504810aa8d1dc6027af3157965f87f3431154855
|
||||
size 11787
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b83b957896775bc93363731be30b12aa232bb77334f379a7e3894de3d53ced03
|
||||
size 194
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4a373447ce1fed5e37708c689f10e6e852a69f87d3cb9bf36913f15a6fdba0dd
|
||||
size 34109
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b3a77c355bffcad1e01cbc466e8b7133de4a7411af9a3e1c90610f14f7650298
|
||||
size 1757424
|
||||
Reference in New Issue
Block a user