From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Yordan Karadzhov <y.karadz@gmail.com>, Troy Engel <troyengel@gmail.com>
Subject: [PATCH 2/2] kernel-shark: Add make BUILD_TYPE=X gui to change how the gui is made
Date: Mon, 17 Jun 2019 18:31:31 -0400 [thread overview]
Message-ID: <20190617223221.968420020@goodmis.org> (raw)
In-Reply-To: 20190617223129.706595135@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Add a option to the Makefile called "BUILD_TYPE" that is passed to the CMake
commonds to change how kernelshark is built. The current options are:
make BUILD_TYPE=Debug gui - for "-g" option
make BUILD_TYPE=Release gui - for "-O3" option
make BUILD_TYPE=RelWithDebInfo gui - for "-g -O2" option (default)
make BUILD_TYPE=MinSizeRel gui - for "-Os" option
By default, BUILD_TYPE is set to RelWithDebInfo.
Also change the CMakeLists.txt to use RelWithDebInfo as the default
instead of just Debug.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Makefile | 5 ++++-
kernel-shark/CMakeLists.txt | 2 +-
kernel-shark/README | 6 +++++-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index c9679d42fdbd..ad74a969249f 100644
--- a/Makefile
+++ b/Makefile
@@ -252,8 +252,11 @@ all_cmd: $(CMD_TARGETS)
CMAKE_COMMAND = /usr/bin/cmake
+# Build with "BUILD_TYPE=Release" to remove cmake debug info
+BUILD_TYPE ?= RelWithDebInfo
+
$(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
- $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -D_INSTALL_PREFIX=$(prefix) ..
+ $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -D_INSTALL_PREFIX=$(prefix) ..
gui: force $(CMD_TARGETS) $(kshark-dir)/build/Makefile
$(Q)$(MAKE) $(S) -C $(kshark-dir)/build
diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt
index d932c396e4a6..58a3c3b84309 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -37,7 +37,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pthread -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -pthread -fPIC")
if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif (NOT CMAKE_BUILD_TYPE)
message("\n Build type: ${CMAKE_BUILD_TYPE}")
diff --git a/kernel-shark/README b/kernel-shark/README
index 4fb13698261b..15d6fbab36fd 100644
--- a/kernel-shark/README
+++ b/kernel-shark/README
@@ -59,9 +59,13 @@ CMAKE_XXXX_FLAGS_PACKAGE Command-Line options (see the example below).
Note that when built as a "Package" the RPATH-s of the executables are
set directly to _INSTALL_PREFIX/lib/kernelshark/
-If no build types is specified, the type will be "Debug".
+If no build types is specified, the type will be "RelWithDebInfo".
Examples:
+ make BUILD_TYPE=Release
+
+ or directly with cmake in the kernel-shark/build directory:
+
cmake -D_DOXYGEN_DOC=1 -D_INSTALL_PREFIX=/usr ../
cmake -DCMAKE_BUILD_TYPE=Package -DCMAKE_C_FLAGS_PACKAGE="-O3 -pedantic" ../
--
2.20.1
prev parent reply other threads:[~2019-06-17 22:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 22:31 [PATCH 0/2] kernel-shark: Make some top level "make" changes Steven Rostedt
2019-06-17 22:31 ` [PATCH 1/2] kernel-shark: Have "make clean" run cmake-clean.sh Steven Rostedt
2019-06-18 10:54 ` Yordan Karadzhov (VMware)
2019-06-18 12:58 ` Steven Rostedt
2019-06-17 22:31 ` Steven Rostedt [this message]
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=20190617223221.968420020@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=troyengel@gmail.com \
--cc=y.karadz@gmail.com \
/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).