All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel-shark: install the application in "System" category
@ 2019-03-29 14:05 Tzvetomir Stoyanov
  2019-03-29 14:05 ` [PATCH] kernel-shark: remove hardcoded /usr/local install prefix Tzvetomir Stoyanov
  0 siblings, 1 reply; 3+ messages in thread
From: Tzvetomir Stoyanov @ 2019-03-29 14:05 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

Kernelshark is a system tool, thus should by classified as System application.
The template desktop file is modified to set Kernelshark in "System" category.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 kernel-shark/build/ks.desktop.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel-shark/build/ks.desktop.cmake b/kernel-shark/build/ks.desktop.cmake
index 0b947f1..f1951f0 100644
--- a/kernel-shark/build/ks.desktop.cmake
+++ b/kernel-shark/build/ks.desktop.cmake
@@ -6,4 +6,5 @@ GenericName=Kernel Shark
 Comment=
 Exec=/usr/local/bin/kernelshark
 Icon=@KS_DIR@/icons/ksharkicon.png
+Categories=System;
 Terminal=false
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] kernel-shark: remove hardcoded /usr/local install prefix
  2019-03-29 14:05 [PATCH] kernel-shark: install the application in "System" category Tzvetomir Stoyanov
@ 2019-03-29 14:05 ` Tzvetomir Stoyanov
  2019-03-29 14:45   ` Yordan Karadzhov (VMware)
  0 siblings, 1 reply; 3+ messages in thread
From: Tzvetomir Stoyanov @ 2019-03-29 14:05 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

Installation prefix of kernelshark should not be hardcoded, it should be
configurable at build time. As kernelshark and trace-cmd are built together,
they should share the same installation prefix. The patch removes hardcoded
/usr/local prefix from kernelshark make files and replaces it with the one,
specified in the top Makefile.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 Makefile                                                 | 2 +-
 kernel-shark/CMakeLists.txt                              | 9 ++++++++-
 kernel-shark/build/cmake_clean.sh                        | 1 +
 kernel-shark/build/ks.desktop.cmake                      | 2 +-
 .../org.freedesktop.kshark-record.policy.cmake}          | 2 +-
 kernel-shark/src/CMakeLists.txt                          | 6 +++---
 kernel-shark/src/plugins/CMakeLists.txt                  | 2 +-
 7 files changed, 16 insertions(+), 8 deletions(-)
 rename kernel-shark/{org.freedesktop.kshark-record.policy => build/org.freedesktop.kshark-record.policy.cmake} (86%)

diff --git a/Makefile b/Makefile
index b780718..0b08e53 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) -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 20ced14..10cb696 100644
--- a/kernel-shark/CMakeLists.txt
+++ b/kernel-shark/CMakeLists.txt
@@ -40,6 +40,10 @@ set(EXECUTABLE_OUTPUT_PATH "${KS_DIR}/bin")
 set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -g -pthread")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -std=c++11 -pthread")
 
+if(NOT _INSTALL_PREFIX)
+	set(_INSTALL_PREFIX "/usr/local")
+endif()
+
 if (NOT _DEBUG)
 
 	set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O2")
@@ -47,7 +51,7 @@ if (NOT _DEBUG)
 
 endif (NOT _DEBUG)
 
-SET(CMAKE_INSTALL_RPATH "/usr/local/lib/kshark/")
+SET(CMAKE_INSTALL_RPATH "${_INSTALL_PREFIX}/lib/kshark/")
 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 include_directories(${KS_DIR}/src/
@@ -82,4 +86,7 @@ endif ()
 configure_file( ${KS_DIR}/build/ks.desktop.cmake
                 ${KS_DIR}/kernelshark.desktop)
 
+configure_file( ${KS_DIR}/build/org.freedesktop.kshark-record.policy.cmake
+                ${KS_DIR}/org.freedesktop.kshark-record.policy)
+
 message("")
diff --git a/kernel-shark/build/cmake_clean.sh b/kernel-shark/build/cmake_clean.sh
index ea04dc0..2e7c8f9 100755
--- a/kernel-shark/build/cmake_clean.sh
+++ b/kernel-shark/build/cmake_clean.sh
@@ -7,6 +7,7 @@ rm -rf src/
 rm -rf examples/
 rm -f ../lib/*
 rm ../kernelshark.desktop
+rm ../org.freedesktop.kshark-record.policy
 rm -f ../src/KsCmakeDef.hpp
 rm -f CMakeDoxyfile.in
 rm -f CMakeDoxygenDefaults.cmake
diff --git a/kernel-shark/build/ks.desktop.cmake b/kernel-shark/build/ks.desktop.cmake
index f1951f0..10e3610 100644
--- a/kernel-shark/build/ks.desktop.cmake
+++ b/kernel-shark/build/ks.desktop.cmake
@@ -4,7 +4,7 @@ Type=Application
 Name=Kernel Shark
 GenericName=Kernel Shark
 Comment=
-Exec=/usr/local/bin/kernelshark
+Exec=@_INSTALL_PREFIX@/bin/kernelshark
 Icon=@KS_DIR@/icons/ksharkicon.png
 Categories=System;
 Terminal=false
diff --git a/kernel-shark/org.freedesktop.kshark-record.policy b/kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
similarity index 86%
rename from kernel-shark/org.freedesktop.kshark-record.policy
rename to kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
index dc73817..988db78 100644
--- a/kernel-shark/org.freedesktop.kshark-record.policy
+++ b/kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
@@ -11,7 +11,7 @@
       <allow_inactive>auth_admin</allow_inactive>
       <allow_active>auth_admin</allow_active>
     </defaults>
-    <annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/kshark-record</annotate>
+    <annotate key="org.freedesktop.policykit.exec.path">@_INSTALL_PREFIX@/bin/kshark-record</annotate>
     <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
   </action>
 
diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
index 1e0a794..b7dbd7e 100644
--- a/kernel-shark/src/CMakeLists.txt
+++ b/kernel-shark/src/CMakeLists.txt
@@ -78,8 +78,8 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
     target_link_libraries(kshark-record kshark-gui)
 
     install(TARGETS kernelshark kshark-record kshark kshark-plot kshark-gui
-            RUNTIME DESTINATION /usr/local/bin/
-            LIBRARY DESTINATION /usr/local/lib/kshark/)
+            RUNTIME DESTINATION ${_INSTALL_PREFIX}/bin/
+            LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/kshark/)
 
     install(FILES "${KS_DIR}/kernelshark.desktop"
             DESTINATION /usr/share/applications/)
@@ -88,7 +88,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
             DESTINATION /usr/share/polkit-1/actions/)
 
     install(PROGRAMS "${KS_DIR}/bin/kshark-su-record"
-            DESTINATION /usr/local/bin/)
+            DESTINATION ${_INSTALL_PREFIX}/bin/)
 
 endif (Qt5Widgets_FOUND AND Qt5Network_FOUND)
 
diff --git a/kernel-shark/src/plugins/CMakeLists.txt b/kernel-shark/src/plugins/CMakeLists.txt
index 853214e..6098275 100644
--- a/kernel-shark/src/plugins/CMakeLists.txt
+++ b/kernel-shark/src/plugins/CMakeLists.txt
@@ -29,6 +29,6 @@ BUILD_PLUGIN(NAME missed_events
 list(APPEND PLUGIN_LIST "missed_events default") # This plugin will be loaded by default
 
 install(TARGETS sched_events missed_events
-        LIBRARY DESTINATION /usr/local/lib/kshark/)
+        LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/kshark/)
 
 set(PLUGINS ${PLUGIN_LIST} PARENT_SCOPE)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel-shark: remove hardcoded /usr/local install prefix
  2019-03-29 14:05 ` [PATCH] kernel-shark: remove hardcoded /usr/local install prefix Tzvetomir Stoyanov
@ 2019-03-29 14:45   ` Yordan Karadzhov (VMware)
  0 siblings, 0 replies; 3+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-03-29 14:45 UTC (permalink / raw)
  To: Tzvetomir Stoyanov, rostedt; +Cc: linux-trace-devel



On 29.03.19 г. 16:05 ч., Tzvetomir Stoyanov wrote:
> Installation prefix of kernelshark should not be hardcoded, it should be
> configurable at build time. As kernelshark and trace-cmd are built together,
> they should share the same installation prefix. The patch removes hardcoded
> /usr/local prefix from kernelshark make files and replaces it with the one,
> specified in the top Makefile.
> 

Maybe you need to add a comment explaning that, one has to run

kernel-shark/build/cmake_clean.sh

after applying the patch

Also please update the kernel-shark/README file describing the 
-D_INSTALL_PREFIX cmake option



> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>   Makefile                                                 | 2 +-
>   kernel-shark/CMakeLists.txt                              | 9 ++++++++-
>   kernel-shark/build/cmake_clean.sh                        | 1 +
>   kernel-shark/build/ks.desktop.cmake                      | 2 +-
>   .../org.freedesktop.kshark-record.policy.cmake}          | 2 +-
>   kernel-shark/src/CMakeLists.txt                          | 6 +++---
>   kernel-shark/src/plugins/CMakeLists.txt                  | 2 +-
>   7 files changed, 16 insertions(+), 8 deletions(-)
>   rename kernel-shark/{org.freedesktop.kshark-record.policy => build/org.freedesktop.kshark-record.policy.cmake} (86%)
> 
> diff --git a/Makefile b/Makefile
> index b780718..0b08e53 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) -D_INSTALL_PREFIX=$(prefix) ..
>   

  trailing whitespace here


Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Tested-by: Yordan Karadzhov <ykaradzhov@vmware.com>

>   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..10cb696 100644
> --- a/kernel-shark/CMakeLists.txt
> +++ b/kernel-shark/CMakeLists.txt
> @@ -40,6 +40,10 @@ set(EXECUTABLE_OUTPUT_PATH "${KS_DIR}/bin")
>   set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wall -g -pthread")
>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -std=c++11 -pthread")
>   
> +if(NOT _INSTALL_PREFIX)
> +	set(_INSTALL_PREFIX "/usr/local")
> +endif()
> +
>   if (NOT _DEBUG)
>   
>   	set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O2")
> @@ -47,7 +51,7 @@ if (NOT _DEBUG)
>   
>   endif (NOT _DEBUG)
>   
> -SET(CMAKE_INSTALL_RPATH "/usr/local/lib/kshark/")
> +SET(CMAKE_INSTALL_RPATH "${_INSTALL_PREFIX}/lib/kshark/")
>   SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
>   
>   include_directories(${KS_DIR}/src/
> @@ -82,4 +86,7 @@ endif ()
>   configure_file( ${KS_DIR}/build/ks.desktop.cmake
>                   ${KS_DIR}/kernelshark.desktop)
>   
> +configure_file( ${KS_DIR}/build/org.freedesktop.kshark-record.policy.cmake
> +                ${KS_DIR}/org.freedesktop.kshark-record.policy)
> +
>   message("")
> diff --git a/kernel-shark/build/cmake_clean.sh b/kernel-shark/build/cmake_clean.sh
> index ea04dc0..2e7c8f9 100755
> --- a/kernel-shark/build/cmake_clean.sh
> +++ b/kernel-shark/build/cmake_clean.sh
> @@ -7,6 +7,7 @@ rm -rf src/
>   rm -rf examples/
>   rm -f ../lib/*
>   rm ../kernelshark.desktop
> +rm ../org.freedesktop.kshark-record.policy
>   rm -f ../src/KsCmakeDef.hpp
>   rm -f CMakeDoxyfile.in
>   rm -f CMakeDoxygenDefaults.cmake
> diff --git a/kernel-shark/build/ks.desktop.cmake b/kernel-shark/build/ks.desktop.cmake
> index f1951f0..10e3610 100644
> --- a/kernel-shark/build/ks.desktop.cmake
> +++ b/kernel-shark/build/ks.desktop.cmake
> @@ -4,7 +4,7 @@ Type=Application
>   Name=Kernel Shark
>   GenericName=Kernel Shark
>   Comment=
> -Exec=/usr/local/bin/kernelshark
> +Exec=@_INSTALL_PREFIX@/bin/kernelshark
>   Icon=@KS_DIR@/icons/ksharkicon.png
>   Categories=System;
>   Terminal=false
> diff --git a/kernel-shark/org.freedesktop.kshark-record.policy b/kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
> similarity index 86%
> rename from kernel-shark/org.freedesktop.kshark-record.policy
> rename to kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
> index dc73817..988db78 100644
> --- a/kernel-shark/org.freedesktop.kshark-record.policy
> +++ b/kernel-shark/build/org.freedesktop.kshark-record.policy.cmake
> @@ -11,7 +11,7 @@
>         <allow_inactive>auth_admin</allow_inactive>
>         <allow_active>auth_admin</allow_active>
>       </defaults>
> -    <annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/kshark-record</annotate>
> +    <annotate key="org.freedesktop.policykit.exec.path">@_INSTALL_PREFIX@/bin/kshark-record</annotate>
>       <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
>     </action>
>   
> diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
> index 1e0a794..b7dbd7e 100644
> --- a/kernel-shark/src/CMakeLists.txt
> +++ b/kernel-shark/src/CMakeLists.txt
> @@ -78,8 +78,8 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
>       target_link_libraries(kshark-record kshark-gui)
>   
>       install(TARGETS kernelshark kshark-record kshark kshark-plot kshark-gui
> -            RUNTIME DESTINATION /usr/local/bin/
> -            LIBRARY DESTINATION /usr/local/lib/kshark/)
> +            RUNTIME DESTINATION ${_INSTALL_PREFIX}/bin/
> +            LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/kshark/)
>   
>       install(FILES "${KS_DIR}/kernelshark.desktop"
>               DESTINATION /usr/share/applications/)
> @@ -88,7 +88,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
>               DESTINATION /usr/share/polkit-1/actions/)
>   
>       install(PROGRAMS "${KS_DIR}/bin/kshark-su-record"
> -            DESTINATION /usr/local/bin/)
> +            DESTINATION ${_INSTALL_PREFIX}/bin/)
>   
>   endif (Qt5Widgets_FOUND AND Qt5Network_FOUND)
>   
> diff --git a/kernel-shark/src/plugins/CMakeLists.txt b/kernel-shark/src/plugins/CMakeLists.txt
> index 853214e..6098275 100644
> --- a/kernel-shark/src/plugins/CMakeLists.txt
> +++ b/kernel-shark/src/plugins/CMakeLists.txt
> @@ -29,6 +29,6 @@ BUILD_PLUGIN(NAME missed_events
>   list(APPEND PLUGIN_LIST "missed_events default") # This plugin will be loaded by default
>   
>   install(TARGETS sched_events missed_events
> -        LIBRARY DESTINATION /usr/local/lib/kshark/)
> +        LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/kshark/)
>   
>   set(PLUGINS ${PLUGIN_LIST} PARENT_SCOPE)
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-29 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 14:05 [PATCH] kernel-shark: install the application in "System" category Tzvetomir Stoyanov
2019-03-29 14:05 ` [PATCH] kernel-shark: remove hardcoded /usr/local install prefix Tzvetomir Stoyanov
2019-03-29 14:45   ` Yordan Karadzhov (VMware)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.