forked from tmm1/rbtrace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·51 lines (43 loc) · 1022 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -e
bundle check || bundle install
cd ext
[ -f Makefile ] && make clean
ruby extconf.rb
make
cd ..
bundle check
export RUBYOPT="-I.:lib"
bundle exec ruby server.rb &
export PID=$!
trap cleanup INT TERM
cleanup() {
kill $PID
wait $PID || true
}
trace() {
echo ------------------------------------------
echo ./bin/rbtrace -p $PID "$@"
echo ------------------------------------------
bundle exec ./bin/rbtrace -p $PID "$@" &
sleep 2
kill $! || true
wait $! || true
echo
}
trace -m Test.run --devmode
trace -m sleep
trace -m sleep Dir.chdir Dir.pwd Process.pid "String#gsub" "String#*"
trace -m "Kernel#"
trace -m "String#gsub(self,@test)" "String#*(self,__source__)" "String#multiply_vowels(self,self.length,num)"
trace -e 'p(1 + 1)'
trace -h
trace --gc --slow=200
trace --gc -m Dir.
trace --slow=250
trace --slow=250 --slow-methods sleep
trace --gc -m Dir. --slow=250 --slow-methods sleep
trace --gc -m Dir. --slow=250
trace -m Process. Dir.pwd "Proc#call"
trace --firehose
cleanup