Tiktok (comes from tic
, toc
and K
ernel) is a tool to stat program running time in kernel.
The original idea comes from the requirement to measure the efficiency of different
compiler backend optimization algorithms more accurately.
If you have similar requirements to measure LLVM IR, you need to build your kernel with clang
.
Otherwise, use whatever you have.
There is a example.c
under src
, it makes some useless computation.
You can leave it unchanged, or, you can write your own codes.
If you are using gcc
, you need to comment ./prebuild.sh
and -x ir
in Makefile, and copy example.c
as tiktok_target.c
Comment first twos line in prebuild.sh
, and change the filename of your IR output to tiktok_target.c
.
Notice: You need to add attributes to functions, which can be found in tiktok_target.c
when you build example.c
.
# build
cd src && sudo make
# install
insmod tiktok.ko
echo 0 > /proc/tiktoc/bench
# check stat
dmesg
micro-benchmark results can be found under bench/
- Current implementation cannot use most functions from standard libraries. (We can write a runtime library to support some key functions)
- Kernel forbid FP usage, so does Tiktok