Commit Graph

25 Commits

Author SHA1 Message Date
David Blaikie a322f36cfd Make lldb -Werror clean for -Wstring-conversion
Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.

llvm-svn: 291198
2017-01-06 00:38:06 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Greg Clayton baac2afccf Cleanup how we listen for process events by using the broadcaster class name instead of having to catch each process instance as it comes alive.
llvm-svn: 215937
2014-08-18 21:09:50 +00:00
Greg Clayton 46822c7c72 Fixed the lldb_perf_clang.cpp test case to be able to run correctly.
1 - There were some outdated options being passed to clang
2 - There were some bad paths being passed as options
3 - The path to the main.cpp file ("/tmp/main.cpp") was wrong when the tests were being run, now we create a temp file
4 - Added a new ActionType::eNone to do nothing (no continue, step, or kill)

llvm-svn: 202431
2014-02-27 21:35:49 +00:00
Greg Clayton 7b0992d9cd After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.
llvm-svn: 179805
2013-04-18 22:45:39 +00:00
Greg Clayton beb02fd1ea Missed some cases when switching over to using our STD_UNIQUE_PTR macros.
llvm-svn: 179796
2013-04-18 21:01:59 +00:00
Enrico Granata 6f2b4807ee New CallNext action for the test case that causes the next action in the sequence to be called right away
llvm-svn: 179578
2013-04-15 23:52:53 +00:00
Enrico Granata b349efe6dd Enabling test case to write the average+stddev pair to the results
The sketch test case writes avg+stddev for all its metrics:
	<key>fetch-frames</key>
	<dict>
		<key>description</key>
		<string>time to dump backtrace for every frame in every thread</string>
		<key>stddev</key>
		<real>0.006270938361432314</real>
		<key>value</key>
		<real>0.011568079851851851</real>
	</dict>

llvm-svn: 179550
2013-04-15 19:57:32 +00:00
Enrico Granata a571e21c4e - 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
2013-04-15 19:07:38 +00:00
Enrico Granata 1ed58f7baf Enabling metrics to calculate (and dump) their standard deviation
llvm-svn: 178580
2013-04-02 21:59:39 +00:00
Enrico Granata 4e969282fd Misc fixes:
- make an overload of Launch() that takes an init list of const char* if all you need to tweak in the launch info are the command-line arguments
- make Run() return an int that you can use as an exit-code
- make dynamic values work properly when recursing in FetchVariables()
- make the po output more obvious in verbose mode

llvm-svn: 178578
2013-04-02 21:31:18 +00:00
Enrico Granata 8fab9fdac2 Integrating option parsing in TestCase for added convenience
To hook it up to individual test cases:
- define GetLongOptions() in your test case class to return something other than NULL (hopefully an array of options :-)
- implement ParseOption() to check for the short option char and do the right thing - return true at the end if you want more options to come your way or false if you don’t
- make sure that your Setup() call takes int& and char**& so that optind post-processing can happen - and call TestCase::Setup from your setup

llvm-svn: 178482
2013-04-01 18:02:25 +00:00
Greg Clayton 5c78d99921 Make sure the "Release" builds link against the "Release" LLDB.framework and also output the results to /dev/stdout when no outfile is supplied.
llvm-svn: 177791
2013-03-23 00:49:30 +00:00
Greg Clayton 824e5a2caa More cleanup to remove the CoreFoundation classes out of mainstream code (CFCMutableDictionary, CFCMutableArray, CFCString, etc). Now it is only used in the Results.cpp file for Apple builds only.
llvm-svn: 177697
2013-03-22 02:38:49 +00:00
Greg Clayton 880afc5728 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
2013-03-22 02:31:35 +00:00
Greg Clayton 5dbe5d4b62 Add correct file headers to all source files.
llvm-svn: 177625
2013-03-21 03:39:51 +00:00
Greg Clayton ef0d2142ba Modify code to adhere to LLDB coding conventions.
llvm-svn: 177623
2013-03-21 03:32:24 +00:00
Enrico Granata e7ed0afee2 Making a manual mode of operation for measurements, where you can manually call start() and stop() instead of using the function-call syntax
This is especially useful to take measurements that span multiple test steps, or where you need to have different operations fall under the same measurement

An example of use is in the formatters perf test case

llvm-svn: 177597
2013-03-20 23:01:28 +00:00
Enrico Granata e16dfcdb5b Making the test step count a member variable so that it can be accessed easily
llvm-svn: 177594
2013-03-20 22:42:34 +00:00
Enrico Granata f3fb83ac6b Making MemoryGauge work by fixing a Mach API call mistake - saving (and dumping) more information out of the task_info call
llvm-svn: 177580
2013-03-20 21:18:20 +00:00
Greg Clayton 1080fafb69 Update Sketch test case to capture this and use accessors for debugger, target, process and thread.
llvm-svn: 177425
2013-03-19 19:30:33 +00:00
Greg Clayton e0b924e3bf More cleanup on the lldb-perf code:
- TestCase.m_thread is now filled in with the first thread that has a valid
  stop reason. This eliminates the need for the SelectMyThread() functions.
- The first thread that stops for a reason is also set as the selected thread
  in the process in case any command line commands are run.
- Changed launch over to take a SBLaunchInfo parameter so that the launch
  function doesn't keep getting new arguments as they are needed.
- TestCase::Setup() and TestCase::Launch(SBLaunchInfo) now return bool to 
  indicate success of setup and launch.
- ActionWanted::Next(SBThread) was renamed to ActionWanted::StepOver(SBThread)
- ActionWanted::Finish(SBThread) was renamed to ActionWanted::StepOut(SBThread)

llvm-svn: 177376
2013-03-19 04:41:22 +00:00
Greg Clayton 7b8f738227 Code cleanup:
- don't use preprocessor macros
- use switch statements
- don't put anything in the lldb namespace, use "lldb_perf" namespace.
- Pass the action struct into each TestStep() for each step fill in
- Modify the ActionWanted class to have accessors to make the continue, next, finish, kill instead of using preproc macros

llvm-svn: 177332
2013-03-18 22:34:00 +00:00
Enrico Granata 86910577cc <rdar://problem/13228487>
A test case for the performance of some LLDB formatters
Changes and improvements to the testing infrastructure itself

llvm-svn: 177100
2013-03-14 19:00:42 +00:00
Enrico Granata f58cececaa Initial checkin of a new project: LLDB Performance Testing Infrastructure
This is a very basic implementation of a library that easily allows to drive LLDB.framework to write test cases for performance

This is separate from the LLDB testsuite in test/ in that:
a) this uses C++ instead of Python to avoid measures being affected by SWIG
b) this is in very early development and needs lots of tweaking before it can be considered functionally complete
c) this is not meant to test correctness but to help catch performance regressions

There is a sample application built against the library (in darwin/sketch) that uses the famous sample app Sketch as an inferior to measure certain basic parameters of LLDB's behavior.
The resulting output is a PLIST much like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>fetch-frames</key>
		<real>0.13161715522222225</real>
	</dict>
	<dict>
		<key>file-line-bkpt</key>
		<real>0.029111678750000002</real>
	</dict>
	<dict>
		<key>fetch-modules</key>
		<real>0.00026376766666666668</real>
	</dict>
	<dict>
		<key>fetch-vars</key>
		<real>0.17820429311111111</real>
	</dict>
	<dict>
		<key>run-expr</key>
		<real>0.029676525769230768</real>
	</dict>
</array>
</plist>

Areas for improvement:
- code cleanups (I will be out of the office for a couple days this coming week, but please keep ideas coming!)
- more metrics and test cases
- better error checking

This toolkit also comprises a simple event-loop-driven controller for LLDB, similar yet much simpler to what the Driver does to implement the lldb command-line tool.

llvm-svn: 176715
2013-03-08 20:29:13 +00:00