diff mbox series

[2/3] kernel-shark: Save the configuration information in ${HOME}/.kshark

Message ID 20190308171512.15372-3-ykaradzhov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Tuning the KernelShark build system | expand

Commit Message

Yordan Karadzhov March 8, 2019, 5:15 p.m. UTC
By default the "Last session" configuration file will be saved in
${HOME}/.kshark

Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 Makefile                    | 2 +-
 kernel-shark/CMakeLists.txt | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Slavomir Kaslev March 11, 2019, 12:20 p.m. UTC | #1
On Fri, Mar 8, 2019 at 7:16 PM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
>
> By default the "Last session" configuration file will be saved in
> ${HOME}/.kshark

${HOME}/.config/foobar seems to be the standard path these days for
config files[1]. Wdyt about switching it to ${HOME}/.config/khark?

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

-- Slavi

>
> Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  Makefile                    | 2 +-
>  kernel-shark/CMakeLists.txt | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index b780718..967c364 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -254,7 +254,7 @@ all_cmd: $(CMD_TARGETS)
>  CMAKE_COMMAND = /usr/bin/cmake
>
>  $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
> -       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) ..
> +       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DKS_CONF_DIR=$(HOME)/.kshark ..
>
>  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 20ced14..3c3beb0 100644
> --- a/kernel-shark/CMakeLists.txt
> +++ b/kernel-shark/CMakeLists.txt
> @@ -14,7 +14,7 @@ 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.")
> +set(KS_CONF_DIR "$ENV{HOME}/.kshark" CACHE STRING "Directory for configuration files.")
>  file(MAKE_DIRECTORY ${KS_CONF_DIR})
>
>  include(${KS_DIR}/build/FindTraceCmd.cmake)
> @@ -59,7 +59,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_CONF_DIR}")
>
>  add_subdirectory(${KS_DIR}/src)
>  add_subdirectory(${KS_DIR}/examples)
> --
> 2.19.1
>
Steven Rostedt March 11, 2019, 3:33 p.m. UTC | #2
On Mon, 11 Mar 2019 14:20:23 +0200
Slavomir Kaslev <slavomir.kaslev@gmail.com> wrote:

> On Fri, Mar 8, 2019 at 7:16 PM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
> >
> > By default the "Last session" configuration file will be saved in
> > ${HOME}/.kshark  
> 
> ${HOME}/.config/foobar seems to be the standard path these days for
> config files[1]. Wdyt about switching it to ${HOME}/.config/khark?
> 
> [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Yeah, I was talking with Patrick McLean (who is a package maintainer
for Gentoo) at SCaLE and was saying that we should look at .config. And
that's the reference he pointed me to as well.

Note, we may need to use both .config and .cache, as I'm thinking
that .cache is better for the saving of last session, and .config
should be the default for user defined sessions (Export Session).

-- Steve


> 
> -- Slavi
> 
> >
> > Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> > ---
> >  Makefile                    | 2 +-
> >  kernel-shark/CMakeLists.txt | 5 +++--
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index b780718..967c364 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -254,7 +254,7 @@ all_cmd: $(CMD_TARGETS)
> >  CMAKE_COMMAND = /usr/bin/cmake
> >
> >  $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
> > -       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) ..
> > +       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DKS_CONF_DIR=$(HOME)/.kshark ..
> >
> >  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 20ced14..3c3beb0 100644
> > --- a/kernel-shark/CMakeLists.txt
> > +++ b/kernel-shark/CMakeLists.txt
> > @@ -14,7 +14,7 @@ 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.")
> > +set(KS_CONF_DIR "$ENV{HOME}/.kshark" CACHE STRING "Directory for configuration files.")
> >  file(MAKE_DIRECTORY ${KS_CONF_DIR})
> >
> >  include(${KS_DIR}/build/FindTraceCmd.cmake)
> > @@ -59,7 +59,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_CONF_DIR}")
> >
> >  add_subdirectory(${KS_DIR}/src)
> >  add_subdirectory(${KS_DIR}/examples)
> > --
> > 2.19.1
> >  
> 
>
Yordan Karadzhov March 11, 2019, 5:16 p.m. UTC | #3
On 11.03.19 г. 17:33 ч., Steven Rostedt wrote:
> On Mon, 11 Mar 2019 14:20:23 +0200
> Slavomir Kaslev <slavomir.kaslev@gmail.com> wrote:
> 
>> On Fri, Mar 8, 2019 at 7:16 PM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
>>>
>>> By default the "Last session" configuration file will be saved in
>>> ${HOME}/.kshark
>>
>> ${HOME}/.config/foobar seems to be the standard path these days for
>> config files[1]. Wdyt about switching it to ${HOME}/.config/khark?
>>
>> [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
> 
> Yeah, I was talking with Patrick McLean (who is a package maintainer
> for Gentoo) at SCaLE and was saying that we should look at .config. And
> that's the reference he pointed me to as well.
> 
> Note, we may need to use both .config and .cache, as I'm thinking
> that .cache is better for the saving of last session, and .config
> should be the default for user defined sessions (Export Session).
> 

I will rework the patch.
Thanks a lot!
Y.



> -- Steve
> 
> 
>>
>> -- Slavi
>>
>>>
>>> Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>>> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
>>> ---
>>>   Makefile                    | 2 +-
>>>   kernel-shark/CMakeLists.txt | 5 +++--
>>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index b780718..967c364 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -254,7 +254,7 @@ all_cmd: $(CMD_TARGETS)
>>>   CMAKE_COMMAND = /usr/bin/cmake
>>>
>>>   $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
>>> -       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) ..
>>> +       $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DKS_CONF_DIR=$(HOME)/.kshark ..
>>>
>>>   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 20ced14..3c3beb0 100644
>>> --- a/kernel-shark/CMakeLists.txt
>>> +++ b/kernel-shark/CMakeLists.txt
>>> @@ -14,7 +14,7 @@ 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.")
>>> +set(KS_CONF_DIR "$ENV{HOME}/.kshark" CACHE STRING "Directory for configuration files.")
>>>   file(MAKE_DIRECTORY ${KS_CONF_DIR})
>>>
>>>   include(${KS_DIR}/build/FindTraceCmd.cmake)
>>> @@ -59,7 +59,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_CONF_DIR}")
>>>
>>>   add_subdirectory(${KS_DIR}/src)
>>>   add_subdirectory(${KS_DIR}/examples)
>>> --
>>> 2.19.1
>>>   
>>
>>
>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index b780718..967c364 100644
--- a/Makefile
+++ b/Makefile
@@ -254,7 +254,7 @@  all_cmd: $(CMD_TARGETS)
 CMAKE_COMMAND = /usr/bin/cmake
 
 $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
-	$(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) ..
+	$(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DKS_CONF_DIR=$(HOME)/.kshark ..
 
 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 20ced14..3c3beb0 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -14,7 +14,7 @@  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.")
+set(KS_CONF_DIR "$ENV{HOME}/.kshark" CACHE STRING "Directory for configuration files.")
 file(MAKE_DIRECTORY ${KS_CONF_DIR})
 
 include(${KS_DIR}/build/FindTraceCmd.cmake)
@@ -59,7 +59,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_CONF_DIR}")
 
 add_subdirectory(${KS_DIR}/src)
 add_subdirectory(${KS_DIR}/examples)