From patchwork Sat Sep 24 16:38:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Dion X-Patchwork-Id: 42913 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D35DD27BBEA; Sat, 24 Sep 2022 17:39:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 14F6227BBE9 for ; Sat, 24 Sep 2022 17:39:15 +0100 (BST) Received: from localhost ([::1]:45204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oc8BO-0001nQ-9N for patchwork@mira.cbaines.net; Sat, 24 Sep 2022 12:39:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc8BD-0001nI-GJ for guix-patches@gnu.org; Sat, 24 Sep 2022 12:39:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc8BC-00048S-Jq for guix-patches@gnu.org; Sat, 24 Sep 2022 12:39:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oc8BC-00060s-Bf for guix-patches@gnu.org; Sat, 24 Sep 2022 12:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58045] [PATCH] gnu: Add libpatch. Resent-From: Olivier Dion Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Sep 2022 16:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58045 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58045@debbugs.gnu.org Cc: Olivier Dion , othacehe@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166403752423087 (code B ref -1); Sat, 24 Sep 2022 16:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Sep 2022 16:38:44 +0000 Received: from localhost ([127.0.0.1]:45136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc8At-00060I-Ny for submit@debbugs.gnu.org; Sat, 24 Sep 2022 12:38:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:50402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc8Al-000605-Lc for submit@debbugs.gnu.org; Sat, 24 Sep 2022 12:38:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc8Al-0001mm-Gp for guix-patches@gnu.org; Sat, 24 Sep 2022 12:38:35 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:43393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc8Ai-00043C-Fh; Sat, 24 Sep 2022 12:38:34 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28OGcHC4025824 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sat, 24 Sep 2022 12:38:24 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28OGcHC4025824 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1664037505; bh=/11KLkYhV69v1YZLT6/0tFR3tugGI3P0DlfzbF3HBfY=; h=From:To:Cc:Subject:Date:From; b=UxuIhoRVj1r5vlJ/gAkSnIVClX9G9b+JWEjkuMd70q9zLJTpZfBI3PxJQ6pZyglX/ hhFm67LKNF4h4W4Lp903K+hqrBl1cxKXofC+7L3jwoBdS7AGhPok3R6hwcYw/0zhgI Iq5UOtOa4rccfRgYCDgPbQBTR2jW+HfRP0wCVHJw= Date: Sat, 24 Sep 2022 12:38:15 -0400 Message-Id: <3400e6a50d528e085834f77e7159607f22d9b8b9.1664037413.git.olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Sat, 24 Sep 2022 16:38:17 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Olivier Dion X-ACL-Warn: , Olivier Dion via Guix-patches X-Patchwork-Original-From: Olivier Dion via Guix-patches via From: Olivier Dion X-getmail-retrieved-from-mailbox: Patches * gnu/packages/instrumentation.scm (libpatch): New variable. --- gnu/packages/instrumentation.scm | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm index c508801c6b..b611f2b141 100644 --- a/gnu/packages/instrumentation.scm +++ b/gnu/packages/instrumentation.scm @@ -22,6 +22,7 @@ (define-module (gnu packages instrumentation) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) #:use-module (gnu packages datastructures) #:use-module (gnu packages documentation) #:use-module (gnu packages elf) @@ -30,6 +31,7 @@ (define-module (gnu packages instrumentation) #:use-module (gnu packages flex) #:use-module (gnu packages gawk) #:use-module (gnu packages glib) + #:use-module (gnu packages guile) #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages libunwind) #:use-module (gnu packages linux) @@ -207,6 +209,68 @@ (define-public flamegraph with the script @command{flamegraph.pl} and many stackcollapse scripts.") (license license:cddl1.0)))) +(define-public libpatch + (package + (name "libpatch") + (version "1.0.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~old/libpatch") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1sx1sichnnqfi84z37gd04h41vpr8i2vg6yg0jkqxlrv3dys489a")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list + (string-append + "--target=" + ,(platform-linux-architecture + (lookup-platform-by-target-or-system + (or + (%current-target-system) + (%current-system)))))))) + (inputs + (list capstone + elfutils + ;; Uncomment the following if you want tracepoints within libpatch + ;; for debugging. + ;; + ;; lttng-ust + libunwind + liburcu)) + (native-inputs + (list coreutils + ;; test-ftrace.scm + (list coreutils "debug") + ;; For eu-nm in test-ftrace.scm. + (list elfutils "bin") + ;; Put Guile in your profile if you want to use the bindings. + guile-3.0 + ;; test-ftrace.scm + (list guile-3.0 "debug") + gnu-make + ;; test-ftrace.scm + (list gnu-make "debug") + pkg-config + ;; zlib is required by libdw. This can be removed if zlib is put + ;; as a propagated-input of elfutils. + zlib)) + (synopsis "Dynamic binary patcher") + (description + "libpatch is a lightweight C library that can be used by tracers, +debuggers and other tools for insertion of probes in a program at runtime. It +has many strategies to minimize probe overhead and maximize possible +coverage.") + (home-page "https://git.sr.ht/~old/libpatch") + (license (list license:lgpl2.1 license:expat license:gpl3+)) + ;; Libpatch only supports instrumentation for x86_64 right now. Augment + ;; that list in further version. + (supported-systems (list "x86_64-linux")))) + (define-public lttng-modules (package (name "lttng-modules")