[Lldb-commits] [lldb] r177791 - Make sure the "Release" builds link against the "Release" LLDB.framework and also output the results to /dev/stdout when no outfile is supplied.
Greg Clayton
gclayton at apple.com
Fri Mar 22 17:49:31 PDT 2013
Author: gclayton
Date: Fri Mar 22 19:49:30 2013
New Revision: 177791
URL: http://llvm.org/viewvc/llvm-project?rev=177791&view=rev
Log:
Make sure the "Release" builds link against the "Release" LLDB.framework and also output the results to /dev/stdout when no outfile is supplied.
Modified:
lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp
lldb/trunk/tools/lldb-perf/lib/Results.cpp
lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj
Modified: lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp?rev=177791&r1=177790&r2=177791&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp (original)
+++ lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp Fri Mar 22 19:49:30 2013
@@ -48,8 +48,6 @@ public:
{
if (m_exe_path.empty())
return false;
- if (m_out_path.empty())
- return false;
m_launch_info.SetArguments(argv, false);
return true;
}
@@ -67,24 +65,32 @@ public:
case 0:
{
m_total_memory.Start();
+ printf("creating target...\n");
+ m_time_total.Start();
+ m_time_to_create_target.Start();
m_target = m_debugger.CreateTarget(m_exe_path.c_str());
+ printf("creating target...done\n");
const char *clang_argv[] = { "clang --version", NULL };
m_delta_memory.Start();
m_set_bp_main_by_name();
+ m_time_to_create_target.Stop();
m_delta_memory.Stop();
SBLaunchInfo launch_info(clang_argv);
+ printf("start\n");
Launch (launch_info);
}
break;
case 1:
- next_action.StepOver(m_thread);
- break;
- case 2:
- next_action.StepOver(m_thread);
- break;
- case 3:
- next_action.StepOver(m_thread);
- break;
+ puts("stop");
+ m_time_total.Stop();
+// next_action.StepOver(m_thread);
+// break;
+// case 2:
+// next_action.StepOver(m_thread);
+// break;
+// case 3:
+// next_action.StepOver(m_thread);
+// break;
default:
m_total_memory.Stop();
next_action.Kill();
@@ -104,7 +110,13 @@ public:
"The total memory that the current process is using after setting the first breakpoint.",
m_total_memory.GetStopValue().GetResult(NULL, NULL));
- results.Write(m_out_path.c_str());
+ results_dict.AddDouble("time-total",
+ "The time it takes to create the target, set breakpoint at main, launch clang and hit the breakpoint at main.",
+ m_time_total.GetDeltaValue());
+ results_dict.AddDouble("time-to-create-target",
+ "The time it takes to create the clang target.",
+ m_time_to_create_target.GetDeltaValue());
+ results.Write(GetResultFilePath());
}
@@ -156,6 +168,8 @@ private:
TimeMeasurement<std::function<void()>> m_set_bp_main_by_name;
MemoryMeasurement<std::function<void()>> m_delta_memory;
MemoryGauge m_total_memory;
+ TimeGauge m_time_to_create_target;
+ TimeGauge m_time_total;
std::string m_exe_path;
std::string m_out_path;
SBLaunchInfo m_launch_info;
@@ -300,14 +314,6 @@ int main(int argc, const char * argv[])
fprintf (stderr, "error: the '--clang=PATH' option is mandatory\n");
}
- if (test.GetResultFilePath() == NULL)
- {
- // --out-file is mandatory
- option_data.print_help = true;
- option_data.error = true;
- fprintf (stderr, "error: the '--out-file=PATH' option is mandatory\n");
- }
-
if (option_data.print_help)
{
puts(R"(
@@ -315,7 +321,7 @@ NAME
lldb_perf_clang -- a tool that measures LLDB peformance while debugging clang.
SYNOPSIS
- lldb_perf_clang --clang=PATH --out-file=PATH [--verbose --dsym] -- [clang options]
+ lldb_perf_clang --clang=PATH [--out-file=PATH --verbose --dsym] -- [clang options]
DESCRIPTION
Runs a set of static timing and memory tasks against clang and outputs results
Modified: lldb/trunk/tools/lldb-perf/lib/Results.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/lib/Results.cpp?rev=177791&r1=177790&r2=177791&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-perf/lib/Results.cpp (original)
+++ lldb/trunk/tools/lldb-perf/lib/Results.cpp Fri Mar 22 19:49:30 2013
@@ -167,6 +167,9 @@ Results::Write (const char *out_path)
});
CFDataRef xmlData = CFPropertyListCreateData(kCFAllocatorDefault, dict.get(), kCFPropertyListXMLFormat_v1_0, 0, NULL);
+ if (out_path == NULL)
+ out_path = "/dev/stdout";
+
CFURLRef file = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8*)out_path, strlen(out_path), FALSE);
CFURLWriteDataAndPropertiesToResource(file, xmlData, NULL, NULL);
Modified: lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj?rev=177791&r1=177790&r2=177791&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/project.pbxproj Fri Mar 22 19:49:30 2013
@@ -882,7 +882,7 @@
"$(SRCROOT)/../../build/Debug",
);
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- OTHER_LDFLAGS = "-Wl,-rpath, at loader_path/../../../../build/Debug";
+ OTHER_LDFLAGS = "-Wl,-rpath, at loader_path/../../../../build/Release";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../ $(SRCROOT)/../../include/";
More information about the lldb-commits
mailing list