From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MMHxMAnC5WEqfQEAgWs5BA (envelope-from ) for ; Mon, 17 Jan 2022 20:22:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ON99KQnC5WFoVAEAG6o9tA (envelope-from ) for ; Mon, 17 Jan 2022 20:22:49 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 255B71B4C5 for ; Mon, 17 Jan 2022 20:22:49 +0100 (CET) Received: from localhost ([::1]:43216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9Xaa-0006GZ-7B for larch@yhetil.org; Mon, 17 Jan 2022 14:22:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9XYu-0004bg-9m for guix-patches@gnu.org; Mon, 17 Jan 2022 14:21:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9XYs-0002df-65 for guix-patches@gnu.org; Mon, 17 Jan 2022 14:21:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9XYr-0005aX-SQ for guix-patches@gnu.org; Mon, 17 Jan 2022 14:21:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53324] [PATCH] gnu: Add uftrace. Resent-From: Olivier Dion Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Jan 2022 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53324 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53324@debbugs.gnu.org Cc: Olivier Dion X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164244724321445 (code B ref -1); Mon, 17 Jan 2022 19:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2022 19:20:43 +0000 Received: from localhost ([127.0.0.1]:48026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9XYY-0005Zp-MW for submit@debbugs.gnu.org; Mon, 17 Jan 2022 14:20:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:41734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9XYS-0005Zc-5q for submit@debbugs.gnu.org; Mon, 17 Jan 2022 14:20:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9XYL-0003ym-V9 for guix-patches@gnu.org; Mon, 17 Jan 2022 14:20:32 -0500 Received: from smtp.polymtl.ca ([132.207.4.11]:33093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9XYJ-0002Tn-FF for guix-patches@gnu.org; Mon, 17 Jan 2022 14:20:29 -0500 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 20HJKAft013652 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 17 Jan 2022 14:20:18 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 20HJKAft013652 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1642447218; bh=HYLhrxOEJ1nvAS5TlrYeN+Fd2T07oRxFOFxPVuMjdH8=; h=From:To:Cc:Subject:Date:From; b=qQeW8BfTegvcPU0P9wS9PfAs6vN4djP914nCJbtvvaoQm67uGAU9lcwHWUSA1fXHK DTtTZBpfr+LuawLSvI97/Y1Riv0PKiaLIYUGB5BiQ7eWibyy45xFkS3cx5QIth08Vs DxPifgeAnpVasXy5iiPed+T41boKJbiz+0WvRb8g= Date: Mon, 17 Jan 2022 14:20:09 -0500 Message-Id: X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Mon, 17 Jan 2022 19:20:10 +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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Olivier Dion X-ACL-Warn: , Olivier Dion via Guix-patches From: Olivier Dion via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642447369; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=HYLhrxOEJ1nvAS5TlrYeN+Fd2T07oRxFOFxPVuMjdH8=; b=XkvQIs1qsXba4UHSh9+YH9r0pOCBdAxiLJV/BIDNpwmrG2XhDoEy3gNkm/6KKJCnEzhjcb N/CurkFazHdw1RAE1HgEiYkn1NQxZD4opukuT6hbb9uYfwUt3lToSWkhp6pHN0sJ1kbuKi BtaF9EcGEvaG5xKsjf6LuX8dp64Ba9K6mf/Ak5p9rmvqizTXQDd9CJvK9XDb87GzNY1XvK 81xxp2QZwKs+73VCGaeu8ZcwMSE2+ilZ5D9osh+QLLQDBzehSa2Cp8FvLv9JLv67skIBUU /4oR/D0LIB1gR9qX1qKjK0Yk6Y4PH+i8kVYJRBFZaZLMOdUAD6iN71lKriORFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642447369; a=rsa-sha256; cv=none; b=CAT4+rURTE5u0JfWQxA2g7q6ivkUtPV3micFYhLMtzRUcBtO+/NTgC5s7hGjCrR1eJvBrd 4AjaSmfrPgwg/pXgwFED/SdwRjyq1TbVFvunMmWRVWdTvgpFsrveIczhScb7zkevyppPAn uteMoGo8i6fCWBwyWpq6hm4MRpA4Jvrfuaagr6t9Xv/Zob3yvOLk5gWCeTsYYHXVfAVW56 3xOM6Ys2cGMpTWxy1QFgCQn+3DZrzUs6/7ibLa4UZdHvrVAeyjW50FkiPwifn2bCX2TvkX C5qVkt7OwsOLn2iipFXjEbNdOFqXxTEmn1x0iw7qL9o9TcBdybTblBqvvoUwvg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=polymtl.ca header.s=default header.b=qQeW8BfT; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.52 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=polymtl.ca header.s=default header.b=qQeW8BfT; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 255B71B4C5 X-Spam-Score: -3.52 X-Migadu-Scanner: scn1.migadu.com X-TUID: hjAQiLZe7ULB * gnu/packages/instrumentation.scm: (uftrace): New variable. --- gnu/packages/instrumentation.scm | 68 +++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm index 86b80d65ec..9aafc28181 100644 --- a/gnu/packages/instrumentation.scm +++ b/gnu/packages/instrumentation.scm @@ -23,11 +23,16 @@ (define-module (gnu packages instrumentation) #:use-module (gnu packages datastructures) #:use-module (gnu packages documentation) #:use-module (gnu packages elf) + #:use-module (gnu packages engineering) #:use-module (gnu packages flex) #:use-module (gnu packages glib) + #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages libunwind) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) + #:use-module (gnu packages lua) #:use-module (gnu packages man) + #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages popt) @@ -43,7 +48,8 @@ (define-module (gnu packages instrumentation) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix packages)) + #:use-module (guix packages) + #:use-module (guix utils)) (define-public babeltrace (package @@ -238,3 +244,63 @@ (define-public lttng-tools line for tracing control, a @code{lttng-ctl} library for tracing control and a @code{lttng-relayd} for network streaming.") (license (list license:gpl2 license:lgpl2.1)))) + +(define-public uftrace + (package + (name "uftrace") + (version "0.11") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/namhyung/uftrace") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0gk0hv3rnf5czvazz1prg21rf9qlniz42g5b389n8a29hqj4q6xr")))) + (build-system gnu-build-system) + (arguments `(#:make-flags + (list + (string-append "CC=" ,(cc-for-target))) + ;; runtest hang at some point -- probably dues to + ;; failed socket connection -- but we want to keep the + ;; unit tests. Change the target to "test" when fixed. + #:test-target "unittest" + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (setenv "SHELL" (which "sh")) + (invoke "./configure" + (string-append "--prefix=" + (assoc-ref outputs "out"))))) + + (add-after 'unpack 'patch-python-shebangs + (lambda _ + (let ([python (which "python3")]) + (for-each (lambda (path) + (substitute* path + (("/usr/bin/env python") python))) + (cons "misc/gen-autoargs.py" + (find-files "tests" "\\.py$"))))))))) + ;; NOTE! User should add python-3 and luajit to their profile if they + ;; want to do scripting. + (propagated-inputs + (list + capstone + elfutils + libunwind + ncurses)) + (native-inputs + (list + luajit + pandoc + pkg-config + python-3)) + (home-page "https://github.com/namhyung/uftrace") + (synopsis "Function graph tracer for C/C++/Rust") + (description "uftrace is a tool for tracing and analyzing the execution of +programs written in C/C++. It is heavily inspired by the ftrace framework of +the Linux kernel, while supporting userspace programs. It supports various +kind of commands and filters to help analysis of the program execution and +performance. It provides the command @command{uftrace}.") + (license license:gpl2))) -- 2.34.0