diff options
author | Enrico Granata <egranata@apple.com> | 2013-04-15 19:07:38 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-04-15 19:07:38 +0000 |
commit | a571e21c4edae565bf2110c4d22f152f51a35529 (patch) | |
tree | 9112a94efd1e247fcb14b75fd9317ff68cb04098 /lldb | |
parent | fe7a59d9c25285b70d357faaeb035bbfa9286227 (diff) | |
download | bcm5719-llvm-a571e21c4edae565bf2110c4d22f152f51a35529.tar.gz bcm5719-llvm-a571e21c4edae565bf2110c4d22f152f51a35529.zip |
- Adding a relaunch feature to the performance tester: you can use the relaunch if you want to measure multiple runs of your app keeping the same metrics alive. New arguments must be supplied - and the step counter will not be reset (this makes it easy to avoid endless loops)
- Having the Sketch test case relaunch itself
llvm-svn: 179548
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/tools/lldb-perf/darwin/sketch/sketch.cpp | 40 | ||||
-rw-r--r-- | lldb/tools/lldb-perf/lib/TestCase.cpp | 8 | ||||
-rw-r--r-- | lldb/tools/lldb-perf/lib/TestCase.h | 13 |
3 files changed, 50 insertions, 11 deletions
diff --git a/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp b/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp index 66ed9aa35c6..c8578367b5b 100644 --- a/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp +++ b/lldb/tools/lldb-perf/darwin/sketch/sketch.cpp @@ -171,20 +171,25 @@ public: { exit(1); } - + lldb::SBLaunchInfo launch_info = GetLaunchInfo(); m_target = m_debugger.CreateTarget(m_app_path.c_str()); - const char* file_arg = m_doc_path.c_str(); - const char* persist_arg = "-ApplePersistenceIgnoreState"; - const char* persist_skip = "YES"; - const char* empty = nullptr; - const char* args[] = {file_arg,persist_arg,persist_skip,empty}; - SBLaunchInfo launch_info (args); m_file_line_bp_measurement("SKTDocument.m",245); m_file_line_bp_measurement("SKTDocument.m",283); m_file_line_bp_measurement("SKTText.m",326); return Launch (launch_info); } + lldb::SBLaunchInfo + GetLaunchInfo () + { + const char* file_arg = m_doc_path.c_str(); + const char* persist_arg = "-ApplePersistenceIgnoreState"; + const char* persist_skip = "YES"; + const char* empty = nullptr; + const char* args[] = {file_arg,persist_arg,persist_skip,empty}; + return SBLaunchInfo(args); + } + void DoTest () { @@ -199,14 +204,17 @@ public: switch (counter) { case 0: + case 10: { DoTest (); - m_file_line_bp_measurement("SKTDocument.m",254); + if (counter == 0) + m_file_line_bp_measurement("SKTDocument.m",254); next_action.Continue(); } break; case 1: + case 11: { DoTest (); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"properties"); @@ -219,6 +227,7 @@ public: break; case 2: + case 12: { DoTest (); next_action.Continue(); @@ -226,6 +235,7 @@ public: break; case 3: + case 13: { DoTest (); next_action.StepOver(m_thread); @@ -233,6 +243,8 @@ public: break; case 4: + case 14: + { DoTest (); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"layoutManager"); @@ -242,6 +254,7 @@ public: break; case 5: + case 15: { DoTest (); next_action.StepOver(m_thread); @@ -249,6 +262,7 @@ public: break; case 6: + case 16: { DoTest (); next_action.StepOver(m_thread); @@ -256,6 +270,7 @@ public: break; case 7: + case 17: { DoTest (); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"@\"an NSString\""); @@ -266,15 +281,20 @@ public: break; case 8: + case 18: { DoTest (); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"[graphics description]"); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"[selectionIndexes description]"); m_run_expr_measurement(m_thread.GetFrameAtIndex(0),"(BOOL)NSIntersectsRect(rect, graphicDrawingBounds)"); - next_action.Kill(); } break; - + case 9: + { + next_action.Relaunch(GetLaunchInfo()); + break; + } + default: { next_action.Kill(); diff --git a/lldb/tools/lldb-perf/lib/TestCase.cpp b/lldb/tools/lldb-perf/lib/TestCase.cpp index ac8c402ac8b..b3aef6e8d6e 100644 --- a/lldb/tools/lldb-perf/lib/TestCase.cpp +++ b/lldb/tools/lldb-perf/lib/TestCase.cpp @@ -292,6 +292,14 @@ TestCase::Loop () m_process.SetSelectedThread(action.thread); action.thread.StepOver(); break; + case ActionWanted::Type::eRelaunch: + if (m_process.IsValid()) + { + m_process.Kill(); + m_process.Clear(); + } + Launch(action.launch_info); + break; case ActionWanted::Type::eKill: if (m_verbose) printf("kill\n"); diff --git a/lldb/tools/lldb-perf/lib/TestCase.h b/lldb/tools/lldb-perf/lib/TestCase.h index 3d2e0e94fbc..89557982e5f 100644 --- a/lldb/tools/lldb-perf/lib/TestCase.h +++ b/lldb/tools/lldb-perf/lib/TestCase.h @@ -30,13 +30,16 @@ public: eStepOver, eContinue, eStepOut, + eRelaunch, eKill } type; lldb::SBThread thread; + lldb::SBLaunchInfo launch_info; ActionWanted () : type (Type::eContinue), - thread () + thread (), + launch_info (NULL) { } @@ -62,6 +65,14 @@ public: } void + Relaunch (lldb::SBLaunchInfo l) + { + type = Type::eRelaunch; + thread = lldb::SBThread(); + launch_info = l; + } + + void Kill () { type = Type::eKill; |