From patchwork Thu Apr 4 14:56:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10885727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DE8017E1 for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1756E28AA7 for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B85428AAA; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66B642872F for ; Thu, 4 Apr 2019 14:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728935AbfDDO4R (ORCPT ); Thu, 4 Apr 2019 10:56:17 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:34847 "EHLO mail-wm1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727353AbfDDO4Q (ORCPT ); Thu, 4 Apr 2019 10:56:16 -0400 Received: by mail-wm1-f48.google.com with SMTP id y197so3803165wmd.0 for ; Thu, 04 Apr 2019 07:56:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/FzuVrzS4h3pn+/6VJqfH/y/Fb95rWw0bIS27j5PRuU=; b=SMf9AyT5RP3+9IuPAnVJeDFT9KJBWEykfLEZJjIVSf4CYNFcG7PwJkPSroYSbzb3SK aMrPwm8sLTYnd5OrtfY2WjEKOZEepZOr8lNC1/vNHzC431myr+iLezSpL0FnGXQGXWSs PUyckc9ScZFDoCGbX2bP7XyV/R6Il3auxFfYXwx27pvDVFUwy7YgQdSekQF2GgxyWJbi IzD8m7BYx3pTTPizULG+8Ew/iUFqSk/CUSRw+pVrmyYcm08p4D1Cy7Y4njnMS2TGqokj ejKML6nl/bh/SHm6W6OrYW8sBItvAlgyGk2AkZRyQK2IOIn4wqzXANB5yTSTOoasJ5sc Ac1Q== X-Gm-Message-State: APjAAAWJrGndxW0yVDTQh+h0Hcbw38blWYiheidJOI4JtTr0OA7h3RkV kGjJJ2jdpIP2nKXVE0/pRgydQfQII90= X-Google-Smtp-Source: APXvYqzJJXznaoWWIJDOVRRM1VpqokvIZF1cJvOPB5nLHyL5h2UNVHOBNpt4kiIKpdLF8BzM0CGo8g== X-Received: by 2002:a05:600c:2199:: with SMTP id e25mr4292510wme.36.1554389774974; Thu, 04 Apr 2019 07:56:14 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id m13sm21919883wmg.42.2019.04.04.07.56.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 07:56:14 -0700 (PDT) From: Yordan Karadzhov 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 Message-Id: <20190404145603.13592-2-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190404145603.13592-1-ykaradzhov@vmware.com> References: <20190404145603.13592-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) Signed-off-by: Yordan Karadzhov --- 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); From patchwork Thu Apr 4 14:56:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10885729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43D261669 for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC032872F for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2351C28AAC; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFAE628A95 for ; Thu, 4 Apr 2019 14:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727353AbfDDO4R (ORCPT ); Thu, 4 Apr 2019 10:56:17 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51717 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728842AbfDDO4R (ORCPT ); Thu, 4 Apr 2019 10:56:17 -0400 Received: by mail-wm1-f65.google.com with SMTP id 4so3427479wmf.1 for ; Thu, 04 Apr 2019 07:56:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N2fxE5K/n5DZyLKzJ/jBedsWDoAi6ReXcwlWk3hK6RQ=; b=rV4NrkFAnz/pKk/iLVt8rFB9vg7f7dVN0fLqUWqJHYT4oMiiKf4Pn9CANXzO5gFlY5 GzHPmdiLgbT4V+Jbs0YETfK84GRKFrmLqEVLAaUHBJJ7+FS4w66UjDirj5w2Ki/+d4Gy uaJHQcMcRWrMbcXL0AIZT6Wz83+bM927VPF6CzM2BVGcOtYvf/xiB9GgNMcbAkg6NvWz WE9z29AijzQQrlfbKvGCMfStONOLEV9hkGc2vACNSd9oIuTdzmrQPwa+N5dGGOn7fIGC CU+xkVU66CRKGi3Vzk6UTg06C5tP4kYCrVyhtzDzBmNEJdcMg2aD+kGl0qz0Wo8tLFo1 GPSg== X-Gm-Message-State: APjAAAX9f26PYVovO2N5gALLxBhpHJb0z84MiAdulLeNVg6qGEZyoFr+ 5EBHV8Ugg/IudOaK7MSgSLg= X-Google-Smtp-Source: APXvYqzpOFEQM/3j870A9zWJPwPl0WRCnQ/WKE7r/O1pDFIxu1mwNcZwmcOUVZJCyP8mW0p7ahzTWQ== X-Received: by 2002:a1c:6c04:: with SMTP id h4mr4480303wmc.135.1554389775783; Thu, 04 Apr 2019 07:56:15 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id m13sm21919883wmg.42.2019.04.04.07.56.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 07:56:15 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/4] kernel-shark: Set the configuration cache directory via env. variable Date: Thu, 4 Apr 2019 17:56:01 +0300 Message-Id: <20190404145603.13592-3-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190404145603.13592-1-ykaradzhov@vmware.com> References: <20190404145603.13592-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The environment variable ${KS_USER_CONF_DIR} can be used to specify the directory where the "Last session" configuration file will be saved. Suggested-by: Steven Rostedt (VMware) Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsMainWindow.cpp | 19 +++++++++++++------ kernel-shark/src/KsMainWindow.hpp | 2 ++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index d07a89d..39b06d6 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -133,9 +133,8 @@ KsMainWindow::KsMainWindow(QWidget *parent) KsMainWindow::~KsMainWindow() { kshark_context *kshark_ctx(nullptr); - QString file = _KS_CACHE_DIR; - file += "/lastsession.json"; + QString file = lastSessionFile(); _updateSession(); kshark_save_config_file(file.toLocal8Bit().data(), @@ -368,12 +367,20 @@ void KsMainWindow::_open() loadDataFile(fileName); } -void KsMainWindow::_restoreSession() +/** Get the description file of the last session. */ +QString KsMainWindow::lastSessionFile() { - QString file = _KS_CACHE_DIR; - file += "/lastsession.json"; + const char *file = getenv("KS_USER_CONF_DIR"); + + if (!file) + file = _KS_CACHE_DIR; + + return QString(file) + "/lastsession.json"; +} - loadSession(file); +void KsMainWindow::_restoreSession() +{ + loadSession(lastSessionFile()); _graph.updateGeom(); } diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index 78cd442..1ecf2d8 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -37,6 +37,8 @@ public: void loadSession(const QString &fileName); + QString lastSessionFile(); + /** * @brief * From patchwork Thu Apr 4 14:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10885731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 718851800 for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCE82872F for ; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5219228A95; Thu, 4 Apr 2019 14:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A004028A9C for ; Thu, 4 Apr 2019 14:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729003AbfDDO4S (ORCPT ); Thu, 4 Apr 2019 10:56:18 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55542 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728683AbfDDO4S (ORCPT ); Thu, 4 Apr 2019 10:56:18 -0400 Received: by mail-wm1-f67.google.com with SMTP id o25so3402906wmf.5 for ; Thu, 04 Apr 2019 07:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SaAcxvLXdkIUy3oCd1hVeb66KDSze7oeTnLjclEwM08=; b=heW+uMbaW++staYjQrzkJixLlW1HO5clzKYEjfXmZfRUYoZhFRctfKum+D8+y/R3Sl TdLFQqI4mTAMghCV3Qsuhni8TaiF+kqEcltYr4LPPjmJLBvy7OdVuVPQ48sifFR6RObj 34CagG2DtQVbXVIUX2jJZb0A/8l9mnIJp14jM+j7HKhsplDqI3VvaddLZIrRnSA23tzj 1z59un6fT/DLEspE2AWq0H9I8T5jWu82TLmyFpIoDl5L4vyUHyCwSL4nHSOqEk9KbQTo 7fscqHqCnwXXAUkb0DurKpZo+Mm16SfipeCmGeqPmOMUCsPJDCUNEhq56IZ0bGy9HFB/ RmyQ== X-Gm-Message-State: APjAAAVEqXQVrHkgeXRaOXMSFdnuNJi7+CDMhgm6/9ARVHjnYgsNLtkS uoG8pAGiB5EVepN4hcc6VxcYNI/FK14= X-Google-Smtp-Source: APXvYqy4P55bD6sUnQSoaA3rCg4JrGzK6sCQybtH5mvUJ+S5JOHRNd/Zio/ifGhRoBvOkYCeTaziWw== X-Received: by 2002:a1c:a64d:: with SMTP id p74mr4642892wme.89.1554389776500; Thu, 04 Apr 2019 07:56:16 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id m13sm21919883wmg.42.2019.04.04.07.56.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 07:56:16 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 3/4] kernel-shark: Load Last Session from command line Date: Thu, 4 Apr 2019 17:56:02 +0300 Message-Id: <20190404145603.13592-4-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190404145603.13592-1-ykaradzhov@vmware.com> References: <20190404145603.13592-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ./kernelshark -l will load directly the Last Session Signed-off-by : Yordan Karadzhov --- kernel-shark/src/kernelshark.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/kernelshark.cpp b/kernel-shark/src/kernelshark.cpp index 2ec91de..1ec6678 100644 --- a/kernel-shark/src/kernelshark.cpp +++ b/kernel-shark/src/kernelshark.cpp @@ -28,6 +28,7 @@ void usage(const char *prog) printf(" -p register plugin, use plugin name, absolute or relative path\n"); printf(" -u unregister plugin, use plugin name or absolute path\n"); printf(" -s import a session\n"); + printf(" -l import the last session\n"); } int main(int argc, char **argv) @@ -40,7 +41,7 @@ int main(int argc, char **argv) int c; bool fromSession = false; - while ((c = getopt(argc, argv, "hvi:p:u:s:")) != -1) { + while ((c = getopt(argc, argv, "hvi:p:u:s:l")) != -1) { switch(c) { case 'h': usage(argv[0]); @@ -65,6 +66,12 @@ int main(int argc, char **argv) case 's': ks.loadSession(QString(optarg)); fromSession = true; + break; + + case 'l': + ks.loadSession(ks.lastSessionFile()); + fromSession = true; + break; default: break; From patchwork Thu Apr 4 14:56:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10885733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 786B717E1 for ; Thu, 4 Apr 2019 14:56:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62E592872F for ; Thu, 4 Apr 2019 14:56:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5270928A95; Thu, 4 Apr 2019 14:56:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DCEB28AA5 for ; Thu, 4 Apr 2019 14:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728683AbfDDO4T (ORCPT ); Thu, 4 Apr 2019 10:56:19 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46674 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728842AbfDDO4S (ORCPT ); Thu, 4 Apr 2019 10:56:18 -0400 Received: by mail-wr1-f65.google.com with SMTP id t17so4129874wrw.13 for ; Thu, 04 Apr 2019 07:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=frj9H5zYvSb6RavHTSwMKoitEP2oz6MyHpmET+IXKMg=; b=a8T5vBAu1QA+3PLZ7cJNipIBftAeONRhQFw4m6iUF4VIbcMUv5Evsbaw9F7719Jvrl q2Nmmx4IgPZiLoMlpP7dyIxfnFhirVz4rotetROsLk36aPVjkXSe4cC54PWCGSS9xLkS KnqiYr2jGOxMLap35+nxiWRX8T6/ilduC79f7F2fHw+JeSBIstbzf1ZquqA01KPPZxJt Xu2mHKmZoPaWqZ2w+hv48RxN90r7fvUzvlCaTivWskFNgDRF3xLeBoHkEkAIvZ28huq7 U2G55CpdA08H0tFLyXzK2vjCUJ8GuwElDBEgmwZD1wv82EPJXMD8zccqXIIvXM3xOWUS bj3Q== X-Gm-Message-State: APjAAAUY0srv90lzva7oCGpFzTYDF06e/E8EmJRBe4F7BuQCz//6K7mo cZtiMtbJe1LWt9M8Y67AAac= X-Google-Smtp-Source: APXvYqy9uPiFaFJPVmOLkda/npXthhcW4AHkTjwe0mD47GKX0xU866+PvQjtpczjKGvI+xkaTf2Dhw== X-Received: by 2002:adf:f68d:: with SMTP id v13mr4428766wrp.6.1554389777123; Thu, 04 Apr 2019 07:56:17 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id m13sm21919883wmg.42.2019.04.04.07.56.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 07:56:16 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 4/4] kernel-shark: Configuration file directory to be created by the executable Date: Thu, 4 Apr 2019 17:56:03 +0300 Message-Id: <20190404145603.13592-5-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190404145603.13592-1-ykaradzhov@vmware.com> References: <20190404145603.13592-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The build process should not make the directory that will contain KernelShark configuration files. This directory should be made by the application itself. Suggested-by: Steven Rostedt (VMware) Signed-off-by: Yordan Karadzhov --- kernel-shark/CMakeLists.txt | 2 -- kernel-shark/src/KsMainWindow.cpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt index 14d73f5..c6a4abf 100644 --- a/kernel-shark/CMakeLists.txt +++ b/kernel-shark/CMakeLists.txt @@ -17,8 +17,6 @@ set(KS_DIR ${CMAKE_SOURCE_DIR}) 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) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 39b06d6..898e598 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -127,6 +127,9 @@ KsMainWindow::KsMainWindow(QWidget *parent) this, &KsMainWindow::_deselectB); _resizeEmpty(); + + if (!QDir(KS_CACHE_DIR).exists()) + QDir().mkdir(KS_CACHE_DIR); } /** Destroy KernelShark Main window. */