aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYordan Karadzhov (VMware) <y.karadz@gmail.com>2019-07-23 21:25:42 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-23 16:30:35 -0400
commit80940d027767d36db535943e35de4135443dd647 (patch)
tree9619fe0bd956a2cc2f43e4bf8f50e90de48f7ec4
parent6060dcbc9f218c2710c13f778d8bf60d992c53d5 (diff)
downloadtrace-cmd-80940d027767d36db535943e35de4135443dd647.tar.gz
kernel-shark: Get the path to trace-cmd executable from _INSTALL_PREFIX
The absolute path to the trace-cmd executable gets derived from "_INSTALL_PREFIX", and the "Record" dialog will be using its installed version. This is done because nothing guaranties that the trace-cmd executable will be presented at the time when the KernelShark package is built. The rule has one exception and this is the case when the build type is "Debug". In "Debug" mode the "Record" dialog will try to use the version of the trace-cmd executable from the build location. Link: http://lore.kernel.org/linux-trace-devel/20190723182542.1295-1-y.karadz@gmail.com Sugested-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel-shark/CMakeLists.txt8
-rw-r--r--kernel-shark/README7
-rw-r--r--kernel-shark/build/FindTraceCmd.cmake10
3 files changed, 18 insertions, 7 deletions
diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt
index 45c6f233..075c4af7 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -13,6 +13,10 @@ message("\n project: Kernel Shark: (version: ${KS_VERSION_STRING})\n")
set(KS_DIR ${CMAKE_SOURCE_DIR})
+if (NOT _INSTALL_PREFIX)
+ set(_INSTALL_PREFIX "/usr/local")
+endif (NOT _INSTALL_PREFIX)
+
include(${KS_DIR}/build/FindTraceCmd.cmake)
include(${KS_DIR}/build/FindJSONC.cmake)
@@ -50,10 +54,6 @@ if (NOT CMAKE_CXX_FLAGS_PACKAGE)
set(CMAKE_CXX_FLAGS_PACKAGE "-O3")
endif (NOT CMAKE_CXX_FLAGS_PACKAGE)
-if (NOT _INSTALL_PREFIX)
- set(_INSTALL_PREFIX "/usr/local")
-endif (NOT _INSTALL_PREFIX)
-
set(KS_PLUGIN_INSTALL_PREFIX ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/plugins/)
set(KS_ICON KS_icon_shark.svg)
diff --git a/kernel-shark/README b/kernel-shark/README
index 7e50479f..6c360bb1 100644
--- a/kernel-shark/README
+++ b/kernel-shark/README
@@ -86,9 +86,14 @@ By default this build type adds the "-O2" compiler flag. Package maintainers
can chose their own compiler flags by providing the corresponding
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
+-- Note that when built as a "Package" the RPATH-s of the executables are
set directly to _INSTALL_PREFIX/lib/kernelshark/
+-- Note that when built as a "Debug" the "Record" dialog will try to use the
+version of the trace-cmd executable from the build location. In all other cases
+the dialog will derive the absolut path to the trace-cmd executable from
+"_INSTALL_PREFIX", hence the dialog will use the installed version.
+
If no build types is specified, the type will be "RelWithDebInfo".
Examples:
diff --git a/kernel-shark/build/FindTraceCmd.cmake b/kernel-shark/build/FindTraceCmd.cmake
index 2da4eeee..d3e145c3 100644
--- a/kernel-shark/build/FindTraceCmd.cmake
+++ b/kernel-shark/build/FindTraceCmd.cmake
@@ -21,6 +21,12 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
endif (CMAKE_BUILD_TYPE MATCHES Debug)
+if (NOT TRACECMD_EXECUTABLE)
+
+ set(TRACECMD_EXECUTABLE "${_INSTALL_PREFIX}/bin/trace-cmd")
+
+endif (NOT TRACECMD_EXECUTABLE)
+
find_path(TRACECMD_INCLUDE_DIR NAMES trace-cmd/trace-cmd.h
PATHS $ENV{TRACE_CMD}/include/
${CMAKE_SOURCE_DIR}/../include/
@@ -43,11 +49,11 @@ find_path(TRACECMD_INCLUDE_DIR NAMES trace-cmd/trace-cmd.h)
find_library(TRACECMD_LIBRARY NAMES trace-cmd/libtracecmd.so)
find_library(TRACEEVENT_LIBRARY NAMES traceevent/libtraceevent.so)
-IF (TRACECMD_INCLUDE_DIR AND TRACECMD_LIBRARY AND TRACECMD_EXECUTABLE)
+IF (TRACECMD_INCLUDE_DIR AND TRACECMD_LIBRARY)
SET(TRACECMD_FOUND TRUE)
-ENDIF (TRACECMD_INCLUDE_DIR AND TRACECMD_LIBRARY AND TRACECMD_EXECUTABLE)
+ENDIF (TRACECMD_INCLUDE_DIR AND TRACECMD_LIBRARY)
IF (TRACECMD_FOUND)