From: phodina via Guix-patches via <guix-patches@gnu.org>
To: 60052@debbugs.gnu.org, marius@gnu.org
Subject: [bug#60052] [PATCH 1/2] gnu: libbacktrace: Add patch.
Date: Tue, 13 Dec 2022 23:52:28 +0000 [thread overview]
Message-ID: <QpZ0euHuA8KX3tXkr0GYx7W8rFzYloWqNjDNlH9WiFMcPT8MWrpMir0wyDdjA0ID3SlQFvDCJdUciu5zu7i4Zj7PeVSQMO9RAaOt5aEcKfg=@protonmail.com> (raw)
[-- 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
reply other threads:[~2022-12-13 23:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='QpZ0euHuA8KX3tXkr0GYx7W8rFzYloWqNjDNlH9WiFMcPT8MWrpMir0wyDdjA0ID3SlQFvDCJdUciu5zu7i4Zj7PeVSQMO9RAaOt5aEcKfg=@protonmail.com' \
--to=guix-patches@gnu.org \
--cc=60052@debbugs.gnu.org \
--cc=marius@gnu.org \
--cc=phodina@protonmail.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.
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.