-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed
Labels
Description
int fib(int n) {return n <=1 ? 1 : fib(n-1) + fib(n-2); }
int main() {fib(10); return 0;}
How to test native:
bin/clang -pg test.c && ./a.out && gprof -b a.out gmon.out
How to test cross with qemu-user
apt install gcc-s390x-linux-gnu qemu-user-static
bin/clang --target=s390x-linux-gnu -pg test.c -static && ./a.out && gprof -b a.out gmon.out
Known problem:
$ bin/clang --target=s390x-linux-gnu -pg n.c -O2 -static && ./a.out && gprof -b ./a.out gmon.out
Flat profile:
Each sample counts as 0.01 seconds.
no time accumulated
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name