Much more cleanup on the performance testing infrastructure:
- 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
diff --git a/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp b/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp
index 65b601e..8ceec65 100644
--- a/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp
+++ b/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp
@@ -179,21 +179,15 @@
}
}
- void
- Results ()
+ virtual void
+ WriteResults (Results &results)
{
- CFCMutableArray array;
- m_fetch_frames_measurement.Write(array);
- m_file_line_bp_measurement.Write(array);
- m_fetch_modules_measurement.Write(array);
- m_fetch_vars_measurement.Write(array);
- m_run_expr_measurement.Write(array);
-
- CFDataRef xmlData = CFPropertyListCreateData(kCFAllocatorDefault, array.get(), kCFPropertyListXMLFormat_v1_0, 0, NULL);
-
- CFURLRef file = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8*)m_out_path.c_str(), m_out_path.size(), FALSE);
-
- CFURLWriteDataAndPropertiesToResource(file,xmlData,NULL,NULL);
+ m_fetch_frames_measurement.WriteAverageValue(results);
+ m_file_line_bp_measurement.WriteAverageValue(results);
+ m_fetch_modules_measurement.WriteAverageValue(results);
+ m_fetch_vars_measurement.WriteAverageValue(results);
+ m_run_expr_measurement.WriteAverageValue(results);
+ results.Write(m_out_path.c_str());
}
private: