RUSAGE_THREAD is not POSIX; it's Linux-specific. HHVM now compiles on OS X,
and calling getrusage( 2 ) on OS X explodes with:
exception : f_getrusage is not supported: RUSAGE_THREAD is not defined on
this sytem [sic]
HHVM is being ported to Windows, too, where RUSAGE_THREAD is likewise missing.
So check that PHP_OS === 'Linux' before using it.
Change-Id: I6eac7d2bb4edfa1e697ae72f89299d0d5ac135f4
- Put Profiler, ProfileSection and TransactionProfiler in their own
files and rely on Autoloader to use them (maintenance has been
using the autoloader here for some time--we don't profile the
autoloader manually)
- This reduces overhead in WebStart/doMaintenance by only loading
three functions at profiler initialization and defers until the
first profiling call happens
- Inline callback functions in ProfilerSimpleText rather than having
public static functions.
- Small comment and code formatting changes in various touched files.
Change-Id: Idf27677c068c50b847152c523a33e7f0c33fdeeb