3

i have a simple program whose performance is to be measured on a arm cortex a7 machine with linux 3.10 and perf tool 3.4 version

program:

#include<stdio.h>
int i=0;
void main2(void)
{
for(i=0;i<20000;i++);
}
void main3(void)
{
for(i=0;i<30000;i++);
}
void main4(void)
{
for(i=0;i<40000;i++);
}
void main5(void)
{
for(i=0;i<50000;i++);
}
main(void)
{
printf("Main2\n");
main2();
printf("Main3\n");
main3();
printf("Main4\n");
main4();
printf("Main5\n");
main5();
}

perf tool data vizualized using flame graph

#perf record -F 5000 -g a.out
#perf script 1>temp1 2>temp2
#stackcollapse-perf.pl temp1 > temp
#flamegraph.pl temp > temp.svg

temp.svg is below

enter image description here

so my doubt here is what are the unknown traces why would they occur, the reason why i increased my sampling rate to 5000 is i am not able to view main2 and main3 if its around 99

UPDATE: the above unknown symbols are because the perf doesnt know our symbols on a cross platform, so the graph just puts unknown in the hex address of unknown symbols, so its suggested to provide vmlinux file as input to its report, even after provided it. i have observed the report of the perf throws a error along with the report

[trout_fm] with build id 71f5660a1b9cba292e6bb94a5ba3ac20644852dd not found, continuing without symbols 

this is because my vmlinux build id and the buildid with perf.data are not matching ? i think so !

if so, from where did the perf.data get the build id any way ?

provided i have carefully flashed the same image and using same vmlinux perf report -k vmlinux

can any one please help me ? to overcome this issue .

kakeh
  • 403
  • 3
  • 17
  • How do you compile your program ? – Manuel Selva Jul 16 '15 at 06:25
  • i compile it using the `arm-linux-gnueabi` cross compiler, as my executable is supposed to run on the cortex a7 machine, after application is built, i push it to the device and run it there by logging to the device – kakeh Jul 16 '15 at 06:57
  • 1
    have you checked your optimization options to be sure that the compiler is not removing away your functions ? – Manuel Selva Jul 16 '15 at 07:35
  • 1
    Your binary needs debuginfo. Try "-g" option of gcc – Milind Dumbare Jul 17 '15 at 08:08
  • yes i have mentioned -g option too, i have also found that the hex address are being displayed when i do perf report, which is because the perf is not able to trace/map addresses with symbol table, so i have given vmlinux file as a input with option -k, still then also the same problem repeats why so ?? – kakeh Aug 07 '15 at 10:17

0 Answers0