kosslab-kr / uftrace

Function (graph) tracer for user-space
https://uftrace.github.io/slide/
GNU General Public License v2.0
16 stars 0 forks source link

uftrace 분석에 도움되는 자료들 (uftrace tracing, code coverage) #90

Open DanielTimLee opened 5 years ago

DanielTimLee commented 5 years ago

How to trace uftrace with uftrace

make clean
make TRACE=1
gcc -pg -o t-abc tests/s-abc.c
uftrace --no-libcall -a ./uftrace t-abc
Tracing uftrace with uftrace example

How to get code coverage for uftrace

sudo apt install lcov
make clean
make COVERAGE=1
gcc -pg -o t-abc tests/s-abc.c
./uftrace record -L. t-abc
./misc/run-lcov.sh
cd coverage.html
python -m SimpleHTTPServer 18080

# 커버리지 데이터 누적 방지를 위해 reset
make reset-coverage
Coverage Data sample

open index.html coverage.html.zip

Coverage Data sample screenshot
Find more at:

http://korea.gnu.org/manual/release/gcov/gcov_1.ko.html

DanielTimLee commented 5 years ago

Adding a detailed description about this to the Wiki will help.