This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Stop linking _p libs for -pg on FreeBSD 14
ClosedPublic

Authored by emaste on Jun 22 2021, 2:44 PM.

Details

Summary

In FreeBSD 14 we plan to deprecate the _p.a special profiling libraries - see FreeBSD review https://reviews.freebsd.org/D30833 for details.

Diff Detail

Event Timeline

emaste created this revision.Jun 22 2021, 2:44 PM
emaste requested review of this revision.Jun 22 2021, 2:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2021, 2:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dim accepted this revision.Jun 22 2021, 3:33 PM

I mostly agree with this, but for the "silent ignoring" of -pg which this achieves. What would be the consequence of producing an error instead, like -pg not supported for FreeBSD >= 14 ? Too many unexpected failures?

This revision is now accepted and ready to land.Jun 22 2021, 3:33 PM

-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]
This revision was landed with ongoing or failed builds.Jun 26 2021, 3:21 PM
This revision was automatically updated to reflect the committed changes.