Add script to run perf trace with USDT

pull/31/head
Andri Yngvason 2020-04-02 20:49:12 +00:00
parent b215df32a8
commit 6c91b38205
1 changed files with 30 additions and 0 deletions

30
util/trace.sh 100755
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
EVENTS="sdt_wayvnc:* sdt_neatvnc:*"
delete_all_events()
{
for e in $EVENTS; do
sudo perf probe -d "$e" || true
done
}
add_all_events()
{
for e in $EVENTS; do
sudo perf probe "$e"
done
}
sudo perf buildid-cache -a build/wayvnc
sudo perf buildid-cache -a build/subprojects/neatvnc/libneatvnc.so
delete_all_events
add_all_events
trap "sudo chown $USER.$USER perf.data*" EXIT
sudo perf record -aR -e ${EVENTS/ /,}