From cfed3cf33c1a280669cda1015bc86a5c25d2e583 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 26 Mar 2013 18:04:40 +0000 Subject: [PATCH] Change the stepping test to output "total time" for the step as well. llvm-svn: 178043 --- .../common/stepping/lldb-perf-stepping.cpp | 29 +++++++++++++--------- .../lldb-perf/lldbperf.xcodeproj/project.pbxproj | 1 + 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lldb/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp b/lldb/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp index faa7613..3fa21b0 100644 --- a/lldb/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp +++ b/lldb/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp @@ -19,7 +19,8 @@ class StepTest : public TestCase public: StepTest(bool use_single_stepping = false) : m_main_source("stepping-testcase.cpp"), - m_use_single_stepping(use_single_stepping) + m_use_single_stepping(use_single_stepping), + m_time_measurements(nullptr) { } @@ -67,12 +68,12 @@ public: WriteResults (Results &results) { // Gotta turn off the last timer now. - size_t num_time_measurements = m_time_measurements.size(); - - m_time_measurements[num_time_measurements - 1].Stop(); + m_individual_step_times.push_back(m_time_measurements.Stop()); + size_t num_time_measurements = m_individual_step_times.size(); + Results::Dictionary& results_dict = results.GetDictionary(); - const char *short_format_string = "step-time-%d"; + const char *short_format_string = "step-time-%0.2d"; const size_t short_size = strlen(short_format_string) + 5; char short_buffer[short_size]; const char *long_format_string = "The time it takes for step %d in the step sequence."; @@ -86,9 +87,10 @@ public: results_dict.AddDouble(short_buffer, long_buffer, - m_time_measurements[i].GetGauge().GetDeltaValue()); + m_individual_step_times[i]); } + results_dict.AddDouble ("total-time", "Total time spent stepping.", m_time_measurements.GetMetric().GetSum()); results.Write(m_out_path.c_str()); } @@ -138,22 +140,25 @@ private: TestStep (int counter, ActionWanted &next_action) { if (counter > 0) - m_time_measurements[counter - 1].Stop(); - + { + m_individual_step_times.push_back(m_time_measurements.Stop()); + + } + + // Disable the breakpoint, just in case it gets multiple locations we don't want that confusing the stepping. if (counter == 0) m_first_bp.SetEnabled(false); - m_time_measurements.push_back(TimeMeasurement()); next_action.StepOver(m_process.GetThreadAtIndex(0)); - m_time_measurements[counter].Start(); + m_time_measurements.Start(); } - TimeMeasurement > m_do_one_step_over_measurement; SBBreakpoint m_first_bp; SBFileSpec m_main_source; - std::vector > m_time_measurements; + TimeMeasurement m_time_measurements; + std::vector m_individual_step_times; bool m_use_single_stepping; std::string m_app_path; std::string m_out_path; diff --git a/lldb/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj b/lldb/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj index f816aea..d9dbf73 100644 --- a/lldb/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj +++ b/lldb/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj @@ -1091,6 +1091,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + GCC_OPTIMIZATION_LEVEL = 0; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; -- 2.7.4