all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#60052] [PATCH 1/2] gnu: libbacktrace: Add patch.
@ 2022-12-13 23:52 phodina via Guix-patches via
  0 siblings, 0 replies; only message in thread
From: phodina via Guix-patches via @ 2022-12-13 23:52 UTC (permalink / raw)
  To: 60052, marius


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

Hi,

this adds memory analyzer tool from the KDE project.

Unfortunately heaptrack uses some functions from libbacktrack directly even tough they are private. Therefore I had to create a patch.

----
Petr

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

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

From 1f6d4a702a9e125d29bedf3250d26ba45ee96dba Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 14 Dec 2022 00:38:51 +0100
Subject: [PATCH 1/2] gnu: libbacktrace: Add patch.

* gnu/packages/debug.scm (libbacktrace)[source]: Add patch.
* gnu/local.mk: Add patch.
* patches/libbacktrace-remove-static-keyword.patch: New variable.

diff --git a/gnu/local.mk b/gnu/local.mk
index 3329801fa6..6a70b4b48d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1418,6 +1418,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/liba52-link-with-libm.patch		\
   %D%/packages/patches/liba52-set-soname.patch			\
   %D%/packages/patches/liba52-use-mtune-not-mcpu.patch		\
+  %D%/packages/patches/libbacktrace-remove-static-keyword.patch		\
   %D%/packages/patches/libbase-fix-includes.patch		\
   %D%/packages/patches/libbase-use-own-logging.patch		\
   %D%/packages/patches/libbonobo-activation-test-race.patch	\
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 1c4f570fe4..4c0e7c58be 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -695,6 +695,8 @@ (define-public libbacktrace
                 (uri (git-reference
                       (url "https://github.com/ianlancetaylor/libbacktrace")
                       (commit commit)))
+                (patches
+                 (search-patches "libbacktrace-remove-static-keyword.patch"))
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
diff --git a/gnu/packages/patches/libbacktrace-remove-static-keyword.patch b/gnu/packages/patches/libbacktrace-remove-static-keyword.patch
new file mode 100644
index 0000000000..05ae3dddcd
--- /dev/null
+++ b/gnu/packages/patches/libbacktrace-remove-static-keyword.patch
@@ -0,0 +1,40 @@
+From c866f91b07d6d366a88c3fb50f69cfa8eefa10d3 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 12 Dec 2022 22:16:37 +0100
+Subject: [PATCH] Remove static keyword from several function.
+
+
+diff --git a/elf.c b/elf.c
+index ab21d2e..e62b328 100644
+--- a/elf.c
++++ b/elf.c
+@@ -557,7 +557,7 @@ elf_crc32_file (struct backtrace_state *state, int descriptor,
+ /* A dummy callback function used when we can't find a symbol
+    table.  */
+ 
+-static void
++void
+ elf_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED,
+ 	    uintptr_t addr ATTRIBUTE_UNUSED,
+ 	    backtrace_syminfo_callback callback ATTRIBUTE_UNUSED,
+@@ -758,7 +758,7 @@ elf_add_syminfo_data (struct backtrace_state *state,
+ 
+ /* Return the symbol name and value for an ADDR.  */
+ 
+-static void
++void
+ elf_syminfo (struct backtrace_state *state, uintptr_t addr,
+ 	     backtrace_syminfo_callback callback,
+ 	     backtrace_error_callback error_callback ATTRIBUTE_UNUSED,
+@@ -6467,7 +6467,7 @@ backtrace_uncompress_lzma (struct backtrace_state *state,
+    elf_add will need to be called on the descriptor again after
+    base_address is determined.  */
+ 
+-static int
++int
+ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
+ 	 const unsigned char *memory, size_t memory_size,
+ 	 uintptr_t base_address, backtrace_error_callback error_callback,
+-- 
+2.38.1
+
-- 
2.38.1


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

From 556a1e6b4a9cae02012554bc30ac31accc968070 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 14 Dec 2022 00:40:30 +0100
Subject: [PATCH 2/2] gnu: Add heaptrack.

* gnu/packages/kde-systemtools.scm (heaptrack): New variable.

diff --git a/gnu/packages/kde-systemtools.scm b/gnu/packages/kde-systemtools.scm
index 96ed5cb777..02b1775eb0 100644
--- a/gnu/packages/kde-systemtools.scm
+++ b/gnu/packages/kde-systemtools.scm
@@ -21,15 +21,20 @@
 
 (define-module (gnu packages kde-systemtools)
   #:use-module (guix build-system qt)
+  #:use-module (guix build-system cmake)
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages debug)
+  #:use-module (gnu packages datastructures)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages kde)
   #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages qt)
@@ -331,6 +336,64 @@ (define-public ksystemlog
 This package is part of the KDE administration module.")
     (license license:gpl2+)))
 
+(define-public heaptrack
+  (package
+    (name "heaptrack")
+    (version "1.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://invent.kde.org/sdk/heaptrack/-/archive/" version
+                    "/heaptrack-" version ".tar.gz"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          delete-file-recursively "3rdparty"))
+              (sha256
+               (base32
+                "0r6fha800iisg2vqgaaj05h11a96rcgavavx7s7vng6kd47rsj1j"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ;fails due to missing zstd (tst_parser)
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'fix-cmake-3rdparty-files
+                    (lambda* _
+                      (substitute* "CMakeLists.txt"
+                        (("add_subdirectory\\(3rdparty\\)")
+                         "")
+                        (("include_directories\\(3rdparty/robin-map/include\\)")
+                         "")))))))
+    (native-inputs (list pkg-config extra-cmake-modules))
+    (inputs (list boost
+                  ;; elfutils
+                  libbacktrace
+                  libunwind
+                  kcoreaddons
+                  ki18n
+                  kitemmodels
+                  threadweaver
+                  kconfigwidgets
+                  kio
+                  kdiagram
+                  kiconthemes
+                  qtbase-5
+                  qtsvg-5
+                  robin-map
+                  zstd
+                  zlib))
+    (synopsis "Heap memory profiler for Linux")
+    (description
+     "Heaptrack traces all memory allocations and annotates these
+events with stack traces.  Dedicated analysis tools then allow you to interpret
+the heap memory profile to:
+@enumerate
+@item to optimize memory footprint
+@item find memory leaks
+@item find allocation hotspots
+@item find temporary allocations
+@end enumerate")
+    (home-page "https://github.com/KDE/heaptrack")
+    (license license:lgpl2.1+)))
+
 (define-public yakuake
   (package
     (name "yakuake")
-- 
2.38.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-13 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 23:52 [bug#60052] [PATCH 1/2] gnu: libbacktrace: Add patch phodina via Guix-patches via

Code repositories for project(s) associated with this external index

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

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.