Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22097

Source column in perf report shows some [unknown]

$
0
0

For a simple C code like this

#include <stdio.h>int main(){  int i = 0;  FILE *pf;  while (i++<= 1000000) {    if ( i%2 == 0 ) {      pf = fopen( "myfile.txt", "a" );      fprintf( pf, "%d\n", i );      fclose( pf );    } else {      printf("%d ", i);    }  }  return 0;}

I used the following commands to build the binary

$ gcc -c test.c $ gcc -o test -Wl,--emit-relocs \       -Wl,--rpath=/opt/glibc-2.23-install \      -Wl,--dynamic-linker=/opt/glibc-2.23-install/lib/ld-2.23.so \      test.o

Then I ran the following two perf commands to record and report.

$ perf record -e cycles:u -j any,u -a -o perf.data.user -- test$ perf report -i perf.data.user

Part of the output is shown below:

# Overhead  Command  Source Shared Object  Source Symbol                              Target Symbol                              Basic Block Cycles# ........  .......  ....................  .........................................  .........................................  ..................#     7.69%  perf     libc-2.23.so          [.] __GI_____strtoll_l_internal            [.] __GI_____strtoll_l_internal            -     5.13%  perf     perf                  [.] perf_evsel__enable                     [.] perf_evsel__enable                     -     4.49%  perf     perf                  [.] perf_mmap__push                        [.] perf_mmap__push                        -     4.49%  test     libc-2.23.so          [.] _int_malloc                            [.] _int_malloc                            -     3.85%  perf     perf                  [.] __perf_mmap__read_init                 [.] __perf_mmap__read_init                 -     3.85%  perf     ld-2.23.so            [.] strcmp                                 [.] strcmp                                 -     3.85%  test     ld-2.23.so            [.] _dl_map_object_deps                    [.] _dl_map_object_deps                    -     3.21%  perf     perf                  [.] record__mmap_read_evlist.constprop.27  [.] record__mmap_read_evlist.constprop.27  -     2.56%  perf     [unknown]             [.] 0xffffffffb2c00ae7                     [.] __read_nocancel                        -     2.56%  perf     perf                  [.] record__mmap_read_evlist.constprop.27  [.] perf_mmap__push                        -     2.56%  perf     perf                  [.] perf_mmap__push                        [.] record__mmap_read_evlist.constprop.27  -     2.56%  test     libc-2.23.so          [.] malloc                                 [.] malloc                                 -     1.92%  perf     [unknown]             [.] 0xffffffffb2c00ae7                     [.] perf_mmap__push                        -     1.92%  perf     perf                  [.] cmd_record                             [.] cmd_record                             -....

I would like to know what is [unknown] in the source column? and why there is no main in the report? Although I showed part of the output, in fact there is no main in the report file.


Viewing all articles
Browse latest Browse all 22097

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>