summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorOlivier Dion <olivier.dion@polymtl.ca>2022-01-20 14:58:05 +0100
committerMathieu Othacehe <othacehe@gnu.org>2022-01-20 15:25:24 +0100
commit1c98a39b9dbc79662a092e3ea4441724884bf162 (patch)
treed30e7cd23229214e8de2f20bf98a2dcb24e82d93 /gnu
parent1aa269d1d74a7b53ed705def5a8db79fbccb5ce3 (diff)
downloadguix-1c98a39b9dbc79662a092e3ea4441724884bf162.tar.gz
gnu: Add flamegraph.
* gnu/packages/instrumentation.scm (flamegraph): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/instrumentation.scm44
1 files changed, 43 insertions, 1 deletions
diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm
index 86b80d65ec..41e189ebfb 100644
--- a/gnu/packages/instrumentation.scm
+++ b/gnu/packages/instrumentation.scm
@@ -38,12 +38,14 @@
   #:use-module (gnu packages tbb)
   #:use-module (gnu packages xml)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix download)
   #: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 (srfi srfi-26))
 
 (define-public babeltrace
   (package
@@ -153,6 +155,46 @@ create a new one out of an ELF file for analysis or modification.  It come
 with a handful of C++ libraries.")
     (license license:lgpl2.1+)))
 
+(define-public flamegraph
+  ;; No new version since 2019, but there's still some new important commits.
+  (let ((commit "810687f180f3c4929b5d965f54817a5218c9d89b")
+        (revision "1"))
+    (package
+      (name "flamegraph")
+      (version (git-version "1.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/brendangregg/FlameGraph")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1lg02mxzdsm9szn4vcmx76c1bw9gqmxqk8n6v63v03036sc83s22"))))
+      (build-system copy-build-system)
+      (arguments
+       `(#:install-plan
+         ',(map (cut list <> "bin/")
+                '("flamegraph.pl"
+                  "stackcollapse.pl"
+                  "stackcollapse-perf.pl"
+                  "stackcollapse-pmc.pl"
+                  "stackcollapse-stap.pl"
+                  "stackcollapse-instruments.pl"
+                  "stackcollapse-vtune.pl"
+                  "stackcollapse-jstack.pl"
+                  "stackcollapse-gdb.pl"
+                  "stackcollapse-go.pl"
+                  "stackcollapse-vsprof.pl"
+                  "stackcollapse-wcp.pl"))))
+      (inputs (list perl))
+      (home-page "http://www.brendangregg.com/flamegraphs.html")
+      (synopsis "Stack trace visualizer")
+      (description "Flamegraph is a collection of scripts that generate
+interactive SVGs out of traces genated from various tracing tools.  It comes
+with the script @command{flamegraph.pl} and many stackcollapse scripts.")
+      (license license:cddl1.0))))
+
 (define-public lttng-ust
   (package
     (name "lttng-ust")