<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121137>121137</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
SystemZ: Missing gprof support
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wzssyqa
</td>
</tr>
</table>
<pre>
```
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
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVMGO4jgQ_RrnUkrklIGQQw6wbLTSarWH3dPcHMcEjxw7HZehe75-ZAhDDy2NZjQWMqXye6-eqxTLEMzgtG7Yes_Wh0xGOvm5uXwJ4e1FZp3v3xq24cuP74wjOJqO4TZFjmENrNrPmuLswAETfzBxKIGJFtK-W8AuL69Q3H9LIMOaiT2w6rDojtI4httF84Yr-QJbSnAm9jfGe1eM7_7yFyAPpAOBk2TOmondE6xL-q2y0g2QT8MVXChguGG4gYJhKwsf6Z4YptkfIe_glh1G71Lw49pq9iHAxdAJXvQY8xj0_MSQE4FxgaS1MCiVB1Hz19waF1_zwcUHLw8kyahn5znJedDExOGZ-e5SC_f3L_e38xcH0-w7q8ePPWW4gl9w55K1f_Hn7T1O7haB8V1rJSVPR2Pvc-a7P6U6QZDjZDUoHx0FkAF4wUsIWnnXh4LxHTgPZEYNUqk4RitJ9zc-AMM1ACxpc9YAELQ93ra0yJO08FiJdRWDe4nvIlDS2gDwf0j9SfN-ROBk4n1seNY3oq9FLTPdlJVYl1vccsxOTV3XZaWq40pXmpdHVXXbzUb09bbrVL8VMjMNclyViBsuSoFYlArXPeeouk7rjVBsxfUojS2sPY-Fn4fMhBB1U2JZiiqzstM2XJ8CRKcvcD1liOllmJtEyrs4BLbi1gQKDxkyZHXz31sgPX5Kn_0_JgTjhmWOIU6TnymLs21ORFNIM8OWYTsYOsWuUH5k2Ca55S-fZv9ZK2LYXk2kti0uzw1-DQAA___o5Wd2">