unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#60018] [PATCH 1/5] gnu: Add libtraceevent.
@ 2022-12-12 19:58 phodina via Guix-patches via
  2023-09-02  4:55 ` Vagrant Cascadian
  0 siblings, 1 reply; 2+ messages in thread
From: phodina via Guix-patches via @ 2022-12-12 19:58 UTC (permalink / raw)
  To: 60018, leo


[-- Attachment #1.1: Type: text/plain, Size: 68 bytes --]

Hi,

the following patch set adds tracing tools to Linux.

----
Petr

[-- Attachment #1.2: Type: text/html, Size: 164 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-trace-cmd.patch --]
[-- Type: text/x-patch; name=0003-gnu-Add-trace-cmd.patch, Size: 2333 bytes --]

From 78168fe71a768c39f628caffa103507cfbf04ca5 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 12 Dec 2022 15:11:15 +0100
Subject: [PATCH 3/5] gnu: Add trace-cmd.

* gnu/packages/linux.scm (trace-cmd): New variable.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1037dea879..1883a5bdd3 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -6294,6 +6294,42 @@ (define-public tmon
     (license (list license:gpl2         ; the man page
                    license:gpl2+))))    ; the actual rest
 
+(define-public trace-cmd
+  (package
+    (name "trace-cmd")
+    (version "3.1.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/trace-cmd-v"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "1ddzw7069h0cdf7rpw5fcz7jwnhcv1i6s262p0m3c3gvpmfhjzj4"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f
+           #:make-flags #~(list (string-append "pkgconfig_dir="
+                                               #$output "/lib/pkgconfig")
+                                (string-append "etcdir=" #$output "/etc")
+                                (string-append "prefix=" #$output)
+                                (string-append "CC=" #$(cc-for-target)) "libs")
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (add-after 'unpack 'populate-pc
+                          (lambda* _
+                            (substitute* "Makefile"
+                              (("^install:") "install: install_libs ")
+                              (("^all:") "all: libs")))))))
+    (native-inputs (list pkg-config swig))
+    (inputs (list audit libtraceevent libtracefs python zstd))
+    (home-page "https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git")
+    (synopsis "The front-end application to @code{ftrace}")
+    (description
+     "This application provides the front-end application to
+@code{ftrace} and the back-end application to @code{KernelShark}.")
+    (license license:gpl3+)))
+
 (define-public turbostat
   (package
     (name "turbostat")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-libtracefs.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-libtracefs.patch, Size: 2365 bytes --]

From 10eba06d3db8f3380597265a5dc3f5d450f97c73 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 12 Dec 2022 15:10:07 +0100
Subject: [PATCH 2/5] gnu: Add libtracefs.

* gnu/packages/linux.scm (libtracefs): New variable.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 99bce3b8b6..1037dea879 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -9567,6 +9567,44 @@ (define-public libtraceevent
 formats.")
     (license license:gpl3+)))
 
+(define-public libtracefs
+  (package
+    (name "libtracefs")
+    (version "1.6.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/libtracefs-libracefs-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "14y5rqqyb5syi6nc31kwq6605acpr4w6g2mjqx0ppx2jan6g5djf"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f ;no test suite
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (add-after 'unpack 'fix-makefile
+                          (lambda* _
+                            (substitute* "Makefile"
+                              (("/usr/local") #$output)
+                              (("\\$\\(shell which valgrind\\)")
+                               #$(this-package-input "valgrind"))
+                              (("\\$\\(gcc\\)") #$(cc-for-target))
+                              (("/bin/pwd") (which "pwd")))
+                            (substitute* "scripts/utils.mk"
+                              (("\\$\\(pkgconfig_dir\\)")
+                               (string-append #$output "/lib/pkgconfig"))
+                              (("\\$\\(CC\\)") #$(cc-for-target))
+                              (("/bin/pwd") (which "pwd"))))))))
+    (native-inputs (list pkg-config which valgrind))
+    (inputs (list libtraceevent))
+    (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
+    (synopsis "Linux kernel trace file system library")
+    (description "This package provides interface for enabling and
+reading trace events.")
+    (license license:gpl3+)))
+
 (define-public libtree
   (package
     (name "libtree")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0001-gnu-Add-libtraceevent.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-libtraceevent.patch, Size: 2098 bytes --]

From 53e302f5123a959e0ebcce5767663206ce8edc33 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 12 Dec 2022 10:48:07 +0100
Subject: [PATCH 1/5] gnu: Add libtraceevent.

* gnu/packages/linux.scm (libtraceevent): New variable.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c9a21f590f..99bce3b8b6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -9535,6 +9535,38 @@ (define-public libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
 
+(define-public libtraceevent
+  (package
+    (name "libtraceevent")
+    (version "1.6.4")
+    (source (origin
+              (method url-fetch)
+                    (uri
+                     (string-append "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1vnnhkwqy9ds3fqh7c9fvbhi2k2h701ga842j5nggdkyp0wp5c8c"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f ;no test suite
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (add-after 'unpack 'fix-makefile
+                          (lambda* _
+                            (substitute* "Makefile"
+                              (("\\$\\(pkgconfig_dir\\)")
+                               (string-append #$output "/lib/pkgconfig"))
+                              (("/usr/local") #$output)
+                              (("/bin/pwd") (which "pwd")))
+                            (substitute* "scripts/utils.mk"
+                              (("/bin/pwd") (which "pwd"))))))))
+    (native-inputs (list pkg-config which))
+    (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
+    (synopsis "Linux kernel trace event library")
+    (description "This package provides library to parse raw trace event
+formats.")
+    (license license:gpl3+)))
+
 (define-public libtree
   (package
     (name "libtree")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0005-gnu-Add-traceshark.patch --]
[-- Type: text/x-patch; name=0005-gnu-Add-traceshark.patch, Size: 2178 bytes --]

From f04841d72e24abd128116cabd2badc4700e05199 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 12 Dec 2022 15:12:04 +0100
Subject: [PATCH 5/5] gnu: Add traceshark.

* gnu/packages/linux.scm (traceshark): New variable.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 036ad48b76..02babf896a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -179,6 +179,7 @@ (define-module (gnu packages linux)
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system linux-module)
   #:use-module (guix download)
@@ -6333,6 +6334,35 @@ (define-public trace-cmd
 @code{ftrace} and the back-end application to @code{KernelShark}.")
     (license license:gpl3+)))
 
+(define-public traceshark
+  (package
+    (name "traceshark")
+    (version "0.9.13")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/cunctator/traceshark")
+                    (commit (string-append "v" version "-beta"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "167isad5kfv8cv3k3z1hcpv3yc2i7wlabakr6ji0b17zhl68vn8h"))))
+    (build-system qt-build-system)
+    (arguments
+     (list #:tests? #f ; no test suite
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'configure
+                          (lambda* _
+                            (substitute* "traceshark.pro"
+                              (("/usr") #$output))
+                            (invoke "qmake"))))))
+    (inputs (list qtbase-5))
+    (home-page "https://github.com/cunctator/traceshark")
+    (synopsis "Kernel ftrace and perf events visualization")
+    (description "This package provides a graphical viewer for the Ftrace and
+Perf events that can be captured by the Linux kernel.")
+    (license license:gpl3+)))
+
 (define-public turbostat
   (package
     (name "turbostat")
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0004-gnu-Add-kernelshark.patch --]
[-- Type: text/x-patch; name=0004-gnu-Add-kernelshark.patch, Size: 6293 bytes --]

From f2d35e6a46360ed5fdf158c2ae8f037690bd0f80 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 12 Dec 2022 15:01:33 +0100
Subject: [PATCH 4/5] gnu: Add kernelshark.

* gnu/packages/linux.scm (kernelshark): New variable.
* gnu/local.mk: Add patch.
* gnu/patches/kernelshark-disable-tests.patch: New variable.

diff --git a/gnu/local.mk b/gnu/local.mk
index 3329801fa6..b99acad616 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1389,6 +1389,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lightdm-vnc-color-depth.patch		\
   %D%/packages/patches/localed-xorg-keyboard.patch		\
   %D%/packages/patches/kcontacts-incorrect-country-name.patch	\
+  %D%/packages/patches/kernelshark-disable-tests.patch	\
   %D%/packages/patches/kde-cli-tools-delay-mime-db.patch	\
   %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \
   %D%/packages/patches/kiki-level-selection-crash.patch		\
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1883a5bdd3..036ad48b76 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -112,11 +112,13 @@ (define-module (gnu packages linux)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages file)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
@@ -141,6 +143,7 @@ (define-module (gnu packages linux)
   #:use-module (gnu packages nss)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages popt)
@@ -9860,6 +9863,52 @@ (define-public modprobed-db
 directly by @code{make localmodconfig} as described above.")
     (license license:expat)))
 
+(define-public kernelshark
+  (package
+    (name "kernelshark")
+    (version "2.1.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/snapshot/kernel-shark-kernelshark-v"
+                    version ".tar.gz"))
+              ;; These require conectivity and GUI
+              (patches (search-patches "kernelshark-disable-tests.patch"))
+              (sha256
+               (base32
+                "0jw9nngyarnasqrqgc3f5yzjjc7351ydvzavj737cc14f75zkkfl"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:configure-flags #~(list (string-append "-DPKG_CONGIG_DIR="
+                                                    #$output "/lib/pkgconfig")
+                                     (string-append "-D_POLKIT_INSTALL_PREFIX="
+                                      #$output)
+                                     (string-append "-D_INSTALL_PREFIX="
+                                                    #$output))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'fix-font
+                          (lambda* _
+                            ;; Use libre font
+                            (substitute* "CMakeLists.txt"
+                              (("FreeSans")
+                               "FiraSans-Regular")))))))
+    (native-inputs (list doxygen pkg-config))
+    (inputs (list boost
+                  fontconfig
+                  font-fira-sans
+                  freeglut
+                  json-c
+                  qtbase-5
+                  libtracefs
+                  libtraceevent
+                  trace-cmd))
+    (home-page "https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/")
+    (synopsis
+     "GUI frontend for @code{trace-cmd} based Linux kernel Ftrace captures")
+    (description
+     "This package provides a frontend reader of @code{trace-cmd}.")
+    (license license:gpl3+)))
+
 (define-public kconfig-hardened-check
   (package
     (name "kconfig-hardened-check")
diff --git a/gnu/packages/patches/kernelshark-disable-tests.patch b/gnu/packages/patches/kernelshark-disable-tests.patch
new file mode 100644
index 0000000000..032f1830ec
--- /dev/null
+++ b/gnu/packages/patches/kernelshark-disable-tests.patch
@@ -0,0 +1,43 @@
+From 81171884b9b8e8e054447bd982b81671e5cf0bc3 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 12 Dec 2022 16:52:43 +0100
+Subject: [PATCH] Remove problematic tests.
+
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 1814c72..1280bdd 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -9,10 +9,6 @@ target_compile_definitions(kshark-tests PRIVATE "BOOST_TEST_DYN_LINK=1")
+ target_link_libraries(kshark-tests   kshark
+                                      ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ 
+-add_test(NAME              "get_test_data"
+-         COMMAND           ${KS_TEST_DIR}/get_test_data.sh
+-         WORKING_DIRECTORY ${KS_TEST_DIR})
+-
+ add_library(dummy_dpi             SHARED  test-plugin_dpi.c)
+ set_target_properties(dummy_dpi   PROPERTIES PREFIX "plugin-")
+ target_link_libraries(dummy_dpi   kshark)
+@@ -37,18 +33,3 @@ message(STATUS "libkshark-tests")
+ add_test(NAME              "libkshark_tests"
+          COMMAND           ${KS_TEST_DIR}/kshark-tests --log_format=HRF
+          WORKING_DIRECTORY ${KS_TEST_DIR})
+-
+-if (Qt5Widgets_FOUND AND TT_FONT_FILE)
+-
+-    add_executable(kshark-gui-tests          libkshark-gui-tests.cpp)
+-    target_include_directories(kshark-gui-tests PRIVATE ${Boost_INCLUDE_DIRS})
+-    target_compile_definitions(kshark-gui-tests PRIVATE "BOOST_TEST_DYN_LINK=1")
+-    target_link_libraries(kshark-gui-tests   kshark-gui
+-                          ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+-
+-    message(STATUS "libkshark-gui_tests")
+-    add_test(NAME              "libkshark-gui_tests"
+-             COMMAND           ${KS_TEST_DIR}/kshark-gui-tests --log_format=HRF
+-             WORKING_DIRECTORY ${KS_TEST_DIR})
+-
+-endif (Qt5Widgets_FOUND AND TT_FONT_FILE)
+-- 
+2.38.1
+
-- 
2.38.1


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

end of thread, other threads:[~2023-09-02  4:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 19:58 [bug#60018] [PATCH 1/5] gnu: Add libtraceevent phodina via Guix-patches via
2023-09-02  4:55 ` Vagrant Cascadian

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).