linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark
Date: Thu,  4 Apr 2019 17:56:00 +0300	[thread overview]
Message-ID: <20190404145603.13592-2-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190404145603.13592-1-ykaradzhov@vmware.com>

By default the "Last session" configuration file will be saved in
${HOME}/.cache/kernelshark

After applying this patch you may need to clean the CMAKE cache.
This can be done by:

    cd kernel-shark/build/;./cmake_clean.sh; cd -
    make gui

Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 Makefile                          |  5 ++++-
 kernel-shark/CMakeLists.txt       | 13 ++++++++-----
 kernel-shark/README               |  8 +++++++-
 kernel-shark/build/deff.h.cmake   |  4 ++--
 kernel-shark/src/KsMainWindow.cpp |  4 ++--
 5 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index cde45f8..d9b0c0e 100644
--- a/Makefile
+++ b/Makefile
@@ -254,7 +254,10 @@ all_cmd: $(CMD_TARGETS)
 CMAKE_COMMAND = /usr/bin/cmake
 
 $(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) \
+		-D_KS_CACHE_DIR=$(HOME)/.cache/kernelshark \
+		-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 8858eb7..14d73f5 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -12,10 +12,12 @@ message("\n project: Kernel Shark: (version: ${KS_VERSION_STRING})\n")
 
 set(KS_DIR ${CMAKE_SOURCE_DIR})
 
-# Make a directory to hold configuration files. To change this do:
-# cmake .. -DKS_CONF_DIR=/your/preferred/path
-set(KS_CONF_DIR "${KS_DIR}/.ksconf" CACHE STRING "Directory for configuration files.")
-file(MAKE_DIRECTORY ${KS_CONF_DIR})
+# Make a directory to hold cached configuration files. To change this do:
+# cmake .. -D_KS_CACHE_DIR=/your/preferred/path
+set(_KS_CACHE_DIR "$ENV{HOME}/.cache/kernelshark"
+    CACHE STRING "Directory for cached configuration files.")
+
+file(MAKE_DIRECTORY ${_KS_CACHE_DIR})
 
 include(${KS_DIR}/build/FindTraceCmd.cmake)
 include(${KS_DIR}/build/FindJSONC.cmake)
@@ -66,7 +68,8 @@ include_directories(${KS_DIR}/src/
 message("")
 message(STATUS "C flags      : " ${CMAKE_C_FLAGS})
 message(STATUS "CXX flags    : " ${CMAKE_CXX_FLAGS})
-message(STATUS "Linker flags : " ${CMAKE_EXE_LINKER_FLAGS})
+message(STATUS "Linker flags : " ${CMAKE_EXE_LINKER_FLAGS}\n)
+message(STATUS "config. files saved in ${_KS_CACHE_DIR}")
 
 add_subdirectory(${KS_DIR}/src)
 add_subdirectory(${KS_DIR}/examples)
diff --git a/kernel-shark/README b/kernel-shark/README
index 9f7db26..a75b08b 100644
--- a/kernel-shark/README
+++ b/kernel-shark/README
@@ -52,8 +52,14 @@ as a CMake Command-Line option.
 2.1.3 By default, installation prefix is "/usr/local". It can be changed using
 -D_INSTALL_PREFIX= as a CMake Command-Line option.
 
-Example:
+2.1.4 By default, the directory that holds cached configuration files is
+${HOME}/.cache/kernelshark/ .It can be changed using -D_KS_CACHE_DIR=
+as a CMake Command-Line option. Use only absolute paths for this option.
+
+
+Examples:
     cmake -D_DOXYGEN_DOC=1 -D_DEBUG=1 -D_INSTALL_PREFIX=/usr ../
+    cmake -D_KS_CACHE_DIR=${PWD}../.kscache ../
 
 2.2.1 Use "make clean" if you want to delete all already compiled objects.
 
diff --git a/kernel-shark/build/deff.h.cmake b/kernel-shark/build/deff.h.cmake
index 80d624c..f1f6a35 100644
--- a/kernel-shark/build/deff.h.cmake
+++ b/kernel-shark/build/deff.h.cmake
@@ -14,8 +14,8 @@
 /** KernelShark source code path. */
 #cmakedefine KS_DIR "@KS_DIR@"
 
-/** KernelShark configuration directory path. */
-#cmakedefine KS_CONF_DIR "@KS_CONF_DIR@"
+/** KernelShark cache directory path. */
+#cmakedefine _KS_CACHE_DIR "@_KS_CACHE_DIR@"
 
 /** Location of the trace-cmd executable. */
 #cmakedefine TRACECMD_BIN_DIR "@TRACECMD_BIN_DIR@"
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index 7afb721..d07a89d 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -133,7 +133,7 @@ KsMainWindow::KsMainWindow(QWidget *parent)
 KsMainWindow::~KsMainWindow()
 {
 	kshark_context *kshark_ctx(nullptr);
-	QString file = KS_CONF_DIR;
+	QString file = _KS_CACHE_DIR;
 
 	file += "/lastsession.json";
 
@@ -370,7 +370,7 @@ void KsMainWindow::_open()
 
 void KsMainWindow::_restoreSession()
 {
-	QString file = KS_CONF_DIR;
+	QString file = _KS_CACHE_DIR;
 	file += "/lastsession.json";
 
 	loadSession(file);
-- 
2.19.1


  reply	other threads:[~2019-04-04 14:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 14:55 [PATCH 0/4] Various modifications and fixes toward KS 1.0 Yordan Karadzhov
2019-04-04 14:56 ` Yordan Karadzhov [this message]
2019-04-08 15:01   ` [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark Slavomir Kaslev
2019-04-08 15:13     ` Steven Rostedt
2019-04-09 12:23       ` Yordan Karadzhov (VMware)
2019-04-09 13:11         ` Slavomir Kaslev
2019-04-09 13:23         ` Steven Rostedt
2019-04-09 13:33           ` Yordan Karadzhov
2019-04-09 14:59           ` Slavomir Kaslev
2019-04-09 15:11             ` Steven Rostedt
2019-04-09 15:44               ` Slavomir Kaslev
2019-04-09 17:02                 ` Steven Rostedt
2019-04-15 11:05                 ` Yordan Karadzhov (VMware)
2019-04-15 13:11                   ` Slavomir Kaslev
2019-04-15 13:58                     ` Yordan Karadzhov (VMware)
2019-04-15 11:16                 ` Yordan Karadzhov (VMware)
2019-04-15 20:04                   ` Steven Rostedt
2019-04-04 14:56 ` [PATCH 2/4] kernel-shark: Set the configuration cache directory via env. variable Yordan Karadzhov
2019-04-04 14:56 ` [PATCH 3/4] kernel-shark: Load Last Session from command line Yordan Karadzhov
2019-04-04 14:56 ` [PATCH 4/4] kernel-shark: Configuration file directory to be created by the executable Yordan Karadzhov
2019-04-08 15:03   ` Slavomir Kaslev

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=20190404145603.13592-2-ykaradzhov@vmware.com \
    --to=ykaradzhov@vmware.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).