summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-perf/lib/Metric.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-03-14 19:00:42 +0000
committerEnrico Granata <egranata@apple.com>2013-03-14 19:00:42 +0000
commit86910577ccfc9da4b5d21a2d1844a4781413c80a (patch)
tree8301d26ab3bd2460c8ed65485e3ab1488a5d210b /lldb/tools/lldb-perf/lib/Metric.cpp
parent928f65a8aaca0383d24cf036b757bc120eaebcf4 (diff)
downloadbcm5719-llvm-86910577ccfc9da4b5d21a2d1844a4781413c80a.tar.gz
bcm5719-llvm-86910577ccfc9da4b5d21a2d1844a4781413c80a.zip
<rdar://problem/13228487>
A test case for the performance of some LLDB formatters Changes and improvements to the testing infrastructure itself llvm-svn: 177100
Diffstat (limited to 'lldb/tools/lldb-perf/lib/Metric.cpp')
-rw-r--r--lldb/tools/lldb-perf/lib/Metric.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lldb/tools/lldb-perf/lib/Metric.cpp b/lldb/tools/lldb-perf/lib/Metric.cpp
index 885413fc65a..3791dd35409 100644
--- a/lldb/tools/lldb-perf/lib/Metric.cpp
+++ b/lldb/tools/lldb-perf/lib/Metric.cpp
@@ -19,8 +19,9 @@ Metric<T>::Metric () : Metric ("")
{}
template <class T>
-Metric<T>::Metric (const char* n) :
+Metric<T>::Metric (const char* n, const char* d) :
m_name(n ? n : ""),
+m_description(d ? d : ""),
m_dataset ()
{}
@@ -63,10 +64,18 @@ Metric<T>::name ()
}
template <class T>
+const char*
+Metric<T>::description ()
+{
+ return m_description.c_str();
+}
+
+template <class T>
void Metric<T>::WriteImpl (CFCMutableArray& parent, identity<double>)
{
CFCMutableDictionary dict;
- dict.AddValueCString(CFCString("name").get(),m_name.c_str(), true);
+ dict.AddValueCString(CFCString("name").get(),name(), true);
+ dict.AddValueCString(CFCString("description").get(),description(), true);
dict.AddValueDouble(CFCString("value").get(),this->average(), true);
parent.AppendValue(dict.get(), true);
}
@@ -75,7 +84,8 @@ template <class T>
void Metric<T>::WriteImpl (CFCMutableArray& parent, identity<mach_vm_size_t>)
{
CFCMutableDictionary dict;
- dict.AddValueCString(CFCString("name").get(),m_name.c_str(), true);
+ dict.AddValueCString(CFCString("name").get(),name(), true);
+ dict.AddValueCString(CFCString("description").get(),description(), true);
dict.AddValueUInt64(CFCString("value").get(),this->average(), true);
parent.AppendValue(dict.get(), true);
}
OpenPOWER on IntegriCloud