- Added new abtract Results class to keep CoreFoundation out of the tests. There are many subclasses for different settings:
Results::Result::Dictionary
Results::Result::Array
Results::Result::Unsigned
Results::Result::Double
Results::Result::String
- Gauge<T> can now write themselves out via a templatized write to results function:
template <class T>
Results::ResultSP GetResult (const char *description, T value);
- There are four specializations of this so far:
template <>
Results::ResultSP GetResult (const char *description, double value);
template <>
Results::ResultSP GetResult (const char *description, uint64_t value);
template <>
Results::ResultSP GetResult (const char *description, std::string value);
template <>
Results::ResultSP GetResult (const char *description, MemoryStats value);
- Don't emit the virtual memory reading from the task info call as it really doesn't mean much as it includes way too much (shared cache + other stuff we don't have control over)
- Fixed other test cases to build correctly and use the new classes
llvm-svn: 177696
67 lines
1.1 KiB
C++
67 lines
1.1 KiB
C++
//===-- Timer.h -------------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef __PerfTestDriver__Timer__
|
|
#define __PerfTestDriver__Timer__
|
|
|
|
#include "Gauge.h"
|
|
|
|
#include <chrono>
|
|
|
|
using namespace std::chrono;
|
|
|
|
namespace lldb_perf
|
|
{
|
|
class TimeGauge : public Gauge<double>
|
|
{
|
|
public:
|
|
TimeGauge ();
|
|
|
|
virtual
|
|
~TimeGauge ()
|
|
{
|
|
}
|
|
|
|
void
|
|
Start ();
|
|
|
|
double
|
|
Stop ();
|
|
|
|
virtual double
|
|
GetStartValue () const;
|
|
|
|
virtual double
|
|
GetStopValue () const;
|
|
|
|
virtual double
|
|
GetDeltaValue () const;
|
|
|
|
private:
|
|
enum class State
|
|
{
|
|
eNeverUsed,
|
|
eCounting,
|
|
eStopped
|
|
};
|
|
|
|
typedef high_resolution_clock::time_point TimeType;
|
|
TimeType m_start;
|
|
TimeType m_stop;
|
|
double m_delta;
|
|
State m_state;
|
|
|
|
TimeType
|
|
Now ();
|
|
|
|
};
|
|
}
|
|
|
|
#endif /* defined(__PerfTestDriver__Timer__) */
|