emaste added a comment.

`-pg` is still supported (see the `OPT_pg` at line 253), gprof just won't be 
able to "see into" libc, libm, etc.

For example a trivial test case calling snprintf and strcmp in a loop, on 
FreeBSD 11 with _p libs:

    %   cumulative   self              self     total           
   time   seconds   seconds    calls  ms/call  ms/call  name    
   57.5       0.11     0.11        0  100.00%           _mcount [1]
   14.2       0.14     0.03  1000000     0.00     0.00  __vfprintf [5]
    9.3       0.15     0.02        0  100.00%           .mcount (43)
    7.2       0.17     0.01  1000004     0.00     0.00  memset [6]
    4.0       0.18     0.01  1000000     0.00     0.00  __sfvwrite [7]
    2.6       0.18     0.01  1000000     0.00     0.00  snprintf [4]
    2.5       0.19     0.00  2000001     0.00     0.00  memcpy [8]
    1.4       0.19     0.00  1000000     0.00     0.00  localeconv_l [9]
    0.8       0.19     0.00        1     1.60    63.36  main [2]
  ...

Same case linking against non-_p libs:

    %   cumulative   self              self     total           
   time   seconds   seconds    calls  ms/call  ms/call  name    
  100.0       0.00     0.00        1     2.58     2.58  main [1]
    0.0       0.00     0.00        0    0.00%           _start [2]


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104753/new/

https://reviews.llvm.org/D104753

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to