You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by na...@apache.org on 2016/06/10 20:57:08 UTC

incubator-quickstep git commit: Use Google Profiler

Repository: incubator-quickstep
Updated Branches:
  refs/heads/memcpy_opt_profile [created] 40db1f355


Use Google Profiler


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/40db1f35
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/40db1f35
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/40db1f35

Branch: refs/heads/memcpy_opt_profile
Commit: 40db1f3557330e77561be747b4dcad672a53fd04
Parents: 47d0478
Author: Navneet Potti <na...@apache.org>
Authored: Fri Jun 10 15:56:15 2016 -0500
Committer: Navneet Potti <na...@apache.org>
Committed: Fri Jun 10 15:56:15 2016 -0500

----------------------------------------------------------------------
 CMakeLists.txt       |  6 ++++++
 cli/QuickstepCli.cpp | 13 +++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/40db1f35/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d10a78..5b086a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -170,6 +170,12 @@ if(LIBNUMA_FOUND)
   include_directories(${LIBNUMA_INCLUDE_DIR})
 endif()
 
+# Following lines add the gperftools' profiler library to $LIBS.
+# Use these lines to profile quickstep using gperftools.
+include_directories("/usr/include/gperftools")
+link_directories(/usr/lib)
+set(LIBS ${LIBS} profiler)
+
 # Enable C++14 support.
 set(CPP14_SUPPORTED FALSE)
 include(CheckCXXSourceCompiles)

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/40db1f35/cli/QuickstepCli.cpp
----------------------------------------------------------------------
diff --git a/cli/QuickstepCli.cpp b/cli/QuickstepCli.cpp
index 558d6eb..de4a1c6 100644
--- a/cli/QuickstepCli.cpp
+++ b/cli/QuickstepCli.cpp
@@ -36,6 +36,8 @@
 #include <stdlib.h>
 #endif
 
+#include <gperftools/profiler.h>
+
 #include "cli/CliConfig.h"  // For QUICKSTEP_USE_LINENOISE.
 #include "cli/CommandExecutor.hpp"
 #include "cli/DropRelation.hpp"
@@ -430,9 +432,16 @@ int main(int argc, char* argv[]) {
         reset_parser = true;
         break;
       }
+			// Start profiling 
+			if (!query_num) {
+        char *name = "profile.prof";
+        cout << "Writing to " << name << '\n';
+        ProfilerStart(name);
+      }
+      ++query_num;
     }
-
-    if (quitting) {
+    
+		if (quitting) {
       break;
     } else if (reset_parser) {
       parser_wrapper.reset(new SqlParserWrapper());