Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ source ./strace_sample.sh
- $ funk_a
- Earth, Wind, Fire and Water
- $ funk_b
- Get on up
- strace: Can't stat 'funk_a': No such file or directory
- $ dpkg -p strace|grep Vers
- Version: 4.8-1ubuntu5
- $ lsb_release -a
- No LSB modules are available.
- Distributor ID: Ubuntu
- Description: Ubuntu 14.04.5 LTS
- Release: 14.04
- Codename: trusty
- #!/bin/bash
- function funk_a {
- echo "Earth, Wind, Fire and Water"
- }
- function funk_b {
- echo "Get on up"
- strace -o trace_output.txt -c -Ttt funk_a
- }
- strace -o trace_output.txt -Ttt bash -c "$(typeset -f func_a); func_a"
- strace -o trace_output.txt -Ttt -p "$$" &
- func_a
- kill "$!"
- strace -o trace_output.txt -Ttt -p "$$" &
- tail -f trace_output.txt | read # wait for some output in trace_output.txt
- func_a
- kill "$!"
- #!/bin/bash
- echo "Earth, Wind, Fire and Water"
- #!/bin/bash
- function funk_b {
- echo "Get on up"
- #strace -o funk_a.out -c -Ttt funk_a
- strace -o util.out -c -Ttt ./util.sh
- }
- $ funk_b
- Get on up
- Earth, Wind, Fire and Water
- $ more util.out
- % time seconds usecs/call calls errors syscall
- ------ ----------- ----------- --------- --------- ----------------
- 0.00 0.000000 0 7 read
- 0.00 0.000000 0 1 write
- 0.00 0.000000 0 27 18 open
- :
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement