Commit Graph

54 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
Saleem Abdulrasool 28606954bf lldb: remove adhoc implementation of array_sizeof
Replace adhoc inline implementation of llvm::array_lengthof in favour of the
implementation in LLVM.  This is simply a cleanup change, no functional change
intended.

llvm-svn: 211868
2014-06-27 05:17:41 +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
Enrico Granata 78081be1be <rdar://problem/13732521>
Updated the logic for the Sketch test case

llvm-svn: 180966
2013-05-02 22:40:22 +00:00
Enrico Granata 1399419d35 Proper English not optional
llvm-svn: 180053
2013-04-22 21:58:48 +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 b0270899b5 More updates to test cases
llvm-svn: 179560
2013-04-15 21:26:06 +00:00
Enrico Granata 467bca73dd Sketch test now runs 10 times
Data formatters test outputs stddev

llvm-svn: 179559
2013-04-15 21:24:00 +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 85e9d6de5c Sketch test case improvements:
- use the TestCase option parsing
- dump output to stdout when no file is provided

llvm-svn: 179415
2013-04-12 21:31:02 +00:00
Enrico Granata c1c31b2c98 Updated the line on which to break for the formatters test
Moving over to source-regex might be a good idea, but it’s not what we really want to test. Ideally, we would set a regex breakpoint to find the right line, then delete it and set one by file and line with the right line info from before.

llvm-svn: 179246
2013-04-11 00:28:12 +00:00
Greg Clayton b7ad58a0df <rdar://problem/13457391>
LLDB now can use a single dash for all long options for all commands form the command line and from the command interpreter. This involved just switching all calls from getopt_long() to getopt_long_only().

llvm-svn: 178789
2013-04-04 20:35:24 +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
Enrico Granata 4b4e24da61 Proper option parser for the Sketch test case
llvm-svn: 178477
2013-04-01 17:42:02 +00:00
Greg Clayton 5160ce5c72 <rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.

llvm-svn: 178191
2013-03-27 23:08:40 +00:00
Greg Clayton a6b0774d32 <rdar://problem/13327940>
Cleaned up some paths.

llvm-svn: 178177
2013-03-27 20:53:12 +00:00
Greg Clayton ff267c7fa0 Added a source file needed for clang to compile in the lldb_perf_clang test.
llvm-svn: 178176
2013-03-27 20:13:09 +00:00
Greg Clayton f81f751722 <rdar://problem/13327940>
Enhance automated testing to include evaluating function calls.

llvm-svn: 178175
2013-03-27 20:12:14 +00:00
Greg Clayton 84912d7e6c Prune more stuff out of the build and source folders after building clang.
llvm-svn: 178112
2013-03-27 01:46:51 +00:00
Greg Clayton 2d7d09231e Cleaned up how LLDB.framework was being linked to and also how the target dependencies.
llvm-svn: 178085
2013-03-26 22:52:20 +00:00
Greg Clayton ba752b9bfd Trim the output build folder a bit to it isn't so large.
llvm-svn: 178070
2013-03-26 21:00:56 +00:00
Jim Ingham cfed3cf33c Change the stepping test to output "total time" for the step as well.
llvm-svn: 178043
2013-03-26 18:04:40 +00:00
Jim Ingham 08f5fa7a6e Make the stepping perf test case actually work.
llvm-svn: 177964
2013-03-26 01:43:36 +00:00
Greg Clayton 4a10357fb3 Added better measurements to test:
- memory delta and time for: target create
- memory delta and time for: setting breakpoint at main by name
- time to launch and hit bp at main
- overall memory of target create + bp main + run to main
- ovarall time of target create + bp main + run to main

llvm-svn: 177808
2013-03-23 01:35:50 +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 ad900f9c85 Added option parsing to the lldb_perf_clang performance test.
llvm-svn: 177759
2013-03-22 21:12:50 +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
Jim Ingham c4ca6e271c The outline of the stepping perf test case, doesn't do anything yet.
llvm-svn: 177646
2013-03-21 16:48:24 +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
Greg Clayton 384dc726b0 Added a lldb-perf test case that will be used to time various aspects of debugging clang with LLDB.
This test case will measure memory usage and expression timings in frame zero and at higher frames.

llvm-svn: 177617
2013-03-21 00:30:04 +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 d14b6ef6ef Renaming perf. main files from main.cpp to something meaningful
llvm-svn: 177587
2013-03-20 22:12:01 +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 9585fbfc67 <rdar://problem/13443931>
Fixed a crasher in the SourceManager where it wasn't checking the m_target member variable for NULL.

In doing this fix, I hardened this class to have weak pointers to the debugger and target in case they do go away. I also changed SBSourceManager to hold onto weak pointers to the debugger and target so they don't keep objects alive by holding a strong reference to them.

llvm-svn: 177365
2013-03-19 00:20:55 +00:00
Greg Clayton a45a5d86f7 Fixed the README to match the current code.
llvm-svn: 177346
2013-03-18 23:25:00 +00:00
Jim Ingham 3793322df7 Add a comment about how to add a target for a test case.
llvm-svn: 177343
2013-03-18 23:08:30 +00:00
Jim Ingham 65423de84d Move the performance test cases into their own project.
llvm-svn: 177341
2013-03-18 23:05:00 +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