llvm-6502/unittests/Support
Chandler Carruth 73c35d86b9 Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started.

For walltime, we currently use TimeValue's interface and a global
initializer to compute a close approximation of total process runtime.

For user time, this adds support for an somewhat more precise timing
mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock
selected.

For system time, we have to do a full getrusage call to extract the
system time from the OS. This is expensive but unavoidable.

In passing, clean up the implementation of the old APIs and fix some
latent bugs in the Windows code. This might have manifested on Windows
ARM systems or other systems with strange 64-bit integer behavior.

The old API for this both user time and system time simultaneously from
a single getrusage call. While this results in fewer system calls, it
also results in a lower precision user time and if only user time is
desired, it introduces a higher overhead. It may be worthwhile to switch
some of the pass timers to not track system time and directly track user
and wall time. The old API also tracked walltime in a confusing way --
it just set it to the current walltime rather than providing any measure
of wall time since the process started the way buth user and system time
are tracked. The new API is more consistent here.

The plan is to eventually implement these methods for a *child* process
by using the wait3(2) system call to populate an rusage struct
representing the whole subprocess execution. That way, after waiting on
a child process its stats will become accurate and cheap to query.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 23:19:55 +00:00
..
AlignOfTest.cpp [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion. 2012-12-31 19:54:45 +00:00
AllocatorTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
BlockFrequencyTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
Casting.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
CMakeLists.txt Begin sketching out the process interface. 2012-12-31 11:17:50 +00:00
CommandLineTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
ConstantRangeTest.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
DataExtractorTest.cpp DataExtractor: Fix integer truncation issues in LEB128 extraction. 2012-08-20 10:52:11 +00:00
EndianTest.cpp [Support][Endian] Add support for specifying the alignment and native unaligned types. 2013-01-02 20:14:11 +00:00
FileOutputBufferTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
formatted_raw_ostream_test.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
IntegersSubsetTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
LeakDetectorTest.cpp Fix death tests in -Asserts builds. 2010-03-17 01:18:45 +00:00
Makefile
ManagedStatic.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
MathExtrasTest.cpp Fixes warnings emitted by Visual Studio 2010 compiler. 2011-03-01 23:11:57 +00:00
MemoryBufferTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
MemoryTest.cpp Go ahead and get rid of the old page size interface and convert all the 2012-12-31 23:31:56 +00:00
Path.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
ProcessTest.cpp Add time getters to the process interface for requesting the elapsed 2013-01-04 23:19:55 +00:00
raw_ostream_test.cpp Add raw_ostream::write_escaped, for writing escaped strings. 2009-10-17 20:43:08 +00:00
RegexTest.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
SwapByteOrderTest.cpp Merge System into Support. 2010-11-29 18:16:10 +00:00
TimeValue.cpp unittests: Merge SystemTests back into SupportTests. 2010-11-29 22:29:04 +00:00
ValueHandleTest.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
YAMLIOTest.cpp Fix how YAML I/O detects flow sequences. 2013-01-04 19:32:00 +00:00
YAMLParserTest.cpp Allow using MemoryBuffers with yaml::Stream directly. 2012-11-19 23:21:47 +00:00