From: Slavomir Kaslev <kaslevs@vmware.com>
To: Yordan Karadzhov <ykaradzhov@vmware.com>
Cc: rostedt@goodmis.org, linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 4/4] kernel-shark: Configuration file directory to be created by the executable
Date: Mon, 8 Apr 2019 18:03:08 +0300 [thread overview]
Message-ID: <20190408150307.GB6430@box> (raw)
In-Reply-To: <20190404145603.13592-5-ykaradzhov@vmware.com>
On Thu, Apr 04, 2019 at 05:56:03PM +0300, Yordan Karadzhov wrote:
> 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) <rostedt@goodmis.org>
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
> 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);
> }
This should be QtDir().mkpath() since KS_CACHE_DIR is configurable and can be of
the form '/foo/bar/baz'.
Also this code doesn't handle the case when the cache dir is overriden by an
environment variable. I think it's better to move this to where we save the
session rather then here.
-- Slavi
prev parent reply other threads:[~2019-04-08 15:03 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 ` [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark Yordan Karadzhov
2019-04-08 15:01 ` 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 [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=20190408150307.GB6430@box \
--to=kaslevs@vmware.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=ykaradzhov@vmware.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).