linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH v2 1/2] kernel-shark-qt: Add "DEBUG" build mode.
Date: Tue, 18 Sep 2018 20:08:31 +0300	[thread overview]
Message-ID: <20180918170832.7865-1-y.karadz@gmail.com> (raw)

"-g" compiler option is added to both C and C++ compiler flags, allowing
debug information to be generated. If the DEBUG Command-Line option is not
provided or is set to zero, the "-O2" compiler flag is added as well.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark-qt/CMakeLists.txt | 11 +++++++++--
 kernel-shark-qt/README         | 15 +++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/kernel-shark-qt/CMakeLists.txt b/kernel-shark-qt/CMakeLists.txt
index 0187eb4..4a40b11 100644
--- a/kernel-shark-qt/CMakeLists.txt
+++ b/kernel-shark-qt/CMakeLists.txt
@@ -23,8 +23,15 @@ find_package(GLUT)
 set(LIBRARY_OUTPUT_PATH    "${KS_DIR}/lib")
 set(EXECUTABLE_OUTPUT_PATH "${KS_DIR}/bin")
 
-set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -pthread")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -pthread")
+set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -g -pthread")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -std=c++11 -pthread")
+
+if (NOT _DEBUG)
+
+	set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O2")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+
+endif (NOT _DEBUG)
 
 include_directories(${KS_DIR}/src/
                     ${KS_DIR}/build/src/
diff --git a/kernel-shark-qt/README b/kernel-shark-qt/README
index f03288c..84708bd 100644
--- a/kernel-shark-qt/README
+++ b/kernel-shark-qt/README
@@ -31,16 +31,19 @@ the original trace-cmd end traceevent libraries.
     cmake ../
     make
 
-2.1 In order to create a Doxygen documentation add -D_DOXYGEN_DOC=1
+2.1.1 In order to create a Doxygen documentation add -D_DOXYGEN_DOC=1
 as a CMake Command-Line option.
-    cd kernel-shark-qt/build
-    cmake -D_DOXYGEN_DOC=1 ../
-    make
 
-2.2.1 Use "make clean" if you want to delete all already compiled object.
+2.1.2 In order to generates complete debug information to be used by GDB add
+-D_DEBUG=1 as a CMake Command-Line option.
+
+Example:
+    cmake -D_DOXYGEN_DOC=1 -D_DEBUG=1 ../
+
+2.2.1 Use "make clean" if you want to delete all already compiled objects.
 
 2.2.2 Use the script "cmake_clean.sh" if you want to delete all already
-compiled object and all files generated by CMake.
+compiled objects and all files generated by CMake.
 
 3. After building the code "kernel-shark-qt/lib" will contain all libraries
 and "kernel-shark-qt/bin" will contain all executables.
-- 
2.17.1

             reply	other threads:[~2018-09-18 22:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 17:08 Yordan Karadzhov (VMware) [this message]
2018-09-18 17:08 ` [PATCH v2 2/2] kernel-shark-qt: Fix all problems revealed after adding "-O2" compiler flag Yordan Karadzhov (VMware)
2018-09-18 17:17 ` [PATCH v2 1/2] kernel-shark-qt: Add "DEBUG" build mode Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180918170832.7865-1-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).