| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages instrumentation)
|
| 24 | #:use-module (gnu packages)
|
| 25 | #:use-module (gnu packages autotools)
|
| 26 | #:use-module (gnu packages base)
|
| 27 | #:use-module (gnu packages bash)
|
| 28 | #:use-module (gnu packages bison)
|
| 29 | #:use-module (gnu packages boost)
|
| 30 | #:use-module (gnu packages check)
|
| 31 | #:use-module (gnu packages compression)
|
| 32 | #:use-module (gnu packages cpio)
|
| 33 | #:use-module (gnu packages datastructures)
|
| 34 | #:use-module (gnu packages documentation)
|
| 35 | #:use-module (gnu packages elf)
|
| 36 | #:use-module (gnu packages engineering)
|
| 37 | #:use-module (gnu packages file)
|
| 38 | #:use-module (gnu packages compiler-tools)
|
| 39 | #:use-module (gnu packages gawk)
|
| 40 | #:use-module (gnu packages gcc)
|
| 41 | #:use-module (gnu packages glib)
|
| 42 | #:use-module (gnu packages guile)
|
| 43 | #:use-module (gnu packages haskell-xyz)
|
| 44 | #:use-module (gnu packages libunwind)
|
| 45 | #:use-module (gnu packages linux)
|
| 46 | #:use-module (gnu packages llvm)
|
| 47 | #:use-module (gnu packages lua)
|
| 48 | #:use-module (gnu packages man)
|
| 49 | #:use-module (gnu packages ncurses)
|
| 50 | #:use-module (gnu packages oneapi)
|
| 51 | #:use-module (gnu packages perl)
|
| 52 | #:use-module (gnu packages pkg-config)
|
| 53 | #:use-module (gnu packages popt)
|
| 54 | #:use-module (gnu packages python)
|
| 55 | #:use-module (gnu packages python-build)
|
| 56 | #:use-module (gnu packages python-check)
|
| 57 | #:use-module (gnu packages python-xyz)
|
| 58 | #:use-module (gnu packages sphinx)
|
| 59 | #:use-module (gnu packages swig)
|
| 60 | #:use-module (gnu packages xml)
|
| 61 | #:use-module (guix platform)
|
| 62 | #:use-module (guix build-system cmake)
|
| 63 | #:use-module (guix build-system copy)
|
| 64 | #:use-module (guix build-system gnu)
|
| 65 | #:use-module (guix build-system linux-module)
|
| 66 | #:use-module (guix build-system pyproject)
|
| 67 | #:use-module (guix download)
|
| 68 | #:use-module (guix gexp)
|
| 69 | #:use-module (guix git-download)
|
| 70 | #:use-module ((guix licenses) #:prefix license:)
|
| 71 | #:use-module (guix packages)
|
| 72 | #:use-module (srfi srfi-26)
|
| 73 | #:use-module (guix utils))
|
| 74 |
|
| 75 | (define-public babeltrace
|
| 76 | (package
|
| 77 | (name "babeltrace")
|
| 78 | (version "2.1.2")
|
| 79 | (source (origin
|
| 80 | (method url-fetch)
|
| 81 | (uri (string-append "https://www.efficios.com/files/babeltrace/babeltrace2-"
|
| 82 | version ".tar.bz2"))
|
| 83 | (sha256
|
| 84 | (base32 "171cn0y6qbixqggbw7minf4ggfa1j5yc0a1bsj5rnrxd6k93z0qj"))))
|
| 85 | (build-system gnu-build-system)
|
| 86 | (arguments
|
| 87 | `(#:tests? #f |
| 88 | |
| 89 | #:make-flags
|
| 90 | ,#~(list
|
| 91 | (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
|
| 92 | #:configure-flags
|
| 93 | '("--enable-debug-info"
|
| 94 | "--enable-man-pages"
|
| 95 | "--enable-python-bindings"
|
| 96 | "--enable-python-plugins")
|
| 97 | ))
|
| 98 | (inputs
|
| 99 | (list glib))
|
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | (propagated-inputs
|
| 105 | (list elfutils))
|
| 106 | (native-inputs
|
| 107 | (list asciidoc
|
| 108 | bison
|
| 109 | flex
|
| 110 | pkg-config
|
| 111 | python-3
|
| 112 | python-setuptools
|
| 113 | python-sphinx
|
| 114 | swig-4.4
|
| 115 | xmltoman))
|
| 116 | (home-page "https://babeltrace.org/")
|
| 117 | (synopsis "Trace manipulation toolkit")
|
| 118 | (description "Babeltrace 2 is a framework for viewing, converting,
|
| 119 | transforming, and analyzing traces. It is also the reference parser
|
| 120 | implementation of the Common Trace Format (CTF), produced by tools such as
|
| 121 | LTTng and barectf. This package provides a library with a C API, Python 3
|
| 122 | bindings, and the command-line tool @command{babeltrace2}.")
|
| 123 | (license license:expat)))
|
| 124 |
|
| 125 | (define-public babeltrace/dev
|
| 126 | (package/inherit babeltrace
|
| 127 | |
| 128 | |
| 129 | (name "babeltrace-dev")
|
| 130 | (synopsis "Trace manipulation toolkit (variant for plugin developers)")
|
| 131 | (arguments
|
| 132 | (substitute-keyword-arguments arguments
|
| 133 | ((#:phases phases)
|
| 134 | `(modify-phases ,phases
|
| 135 | (add-before 'configure 'set-environment-variables
|
| 136 | (lambda _
|
| 137 | (setenv "BABELTRACE_DEV_MODE" "1")
|
| 138 | (setenv "BABELTRACE_MINIMAL_LOG_LEVEL" "TRACE")))))))))
|
| 139 |
|
| 140 | (define-public barectf
|
| 141 | (package
|
| 142 | (name "barectf")
|
| 143 | (version "3.1.2")
|
| 144 | (source (origin
|
| 145 | (method git-fetch)
|
| 146 | (uri (git-reference
|
| 147 | (url "https://github.com/efficios/barectf")
|
| 148 | (commit (string-append "v" version))))
|
| 149 | (file-name (git-file-name name version))
|
| 150 | (sha256
|
| 151 | (base32
|
| 152 | "0v7w830dqi46bq753x84d0z75dw4cf4r93gpfrv4sjynvmylbs95"))))
|
| 153 | (build-system pyproject-build-system)
|
| 154 | (arguments
|
| 155 | (list #:phases
|
| 156 | #~(modify-phases %standard-phases
|
| 157 | (add-before 'check 'set-CC
|
| 158 | (lambda _
|
| 159 | |
| 160 | (setenv "CC" #$(cc-for-target)))))))
|
| 161 | (native-inputs
|
| 162 | (list python-poetry-core python-pytest-8))
|
| 163 | (propagated-inputs
|
| 164 | (list python-jinja2 python-jsonschema python-pyyaml python-termcolor-1))
|
| 165 | (home-page "https://barectf.org")
|
| 166 | (synopsis "CTF tracer generator")
|
| 167 | (description
|
| 168 | "@command{barectf} is a generator of tracer which produces CTF data
|
| 169 | streams. The generated C source code has no other dependencies than a few C
|
| 170 | standard library headers.")
|
| 171 | (license license:expat)))
|
| 172 |
|
| 173 | (define-public dyninst
|
| 174 | (package
|
| 175 | (name "dyninst")
|
| 176 | (version "13.0.0")
|
| 177 | (source (origin
|
| 178 | (method git-fetch)
|
| 179 | (uri (git-reference
|
| 180 | (url "https://github.com/dyninst/dyninst")
|
| 181 | (commit (string-append "v" version))))
|
| 182 | (file-name (git-file-name name version))
|
| 183 | (sha256
|
| 184 | (base32
|
| 185 | "0vkd9z6zwvn13ynfys2fg5yanv7n9pl7x5z8m1lcnmnb0kwgi035"))))
|
| 186 |
|
| 187 | (build-system cmake-build-system)
|
| 188 | (arguments
|
| 189 | `(#:tests? #f
|
| 190 | |
| 191 | |
| 192 | #:configure-flags
|
| 193 | (list "-DSTERILE_BUILD=ON")
|
| 194 | #:phases
|
| 195 | (modify-phases %standard-phases
|
| 196 | (add-after 'unpack 'adjust-supported-platform-name
|
| 197 | (lambda _
|
| 198 | |
| 199 | |
| 200 | |
| 201 | (substitute* "cmake/DyninstPlatform.cmake"
|
| 202 | (("\"i386\"") "\"i686\"")))))))
|
| 203 | (propagated-inputs
|
| 204 | (list elfutils libiberty boost onetbb-2022))
|
| 205 |
|
| 206 | |
| 207 | (supported-systems '("x86_64-linux" "i686-linux"
|
| 208 | "aarch64-linux" "powerpc64le-linux"))
|
| 209 |
|
| 210 | (home-page "https://dyninst.org/")
|
| 211 | (synopsis "Dynamic instrumentation")
|
| 212 | (description "Dyninst is a collection of libraries for instrumenting,
|
| 213 | analyzing and editing binaries. It can attach to an existing program or
|
| 214 | create a new one out of an ELF file for analysis or modification. It come
|
| 215 | with a handful of C++ libraries.")
|
| 216 | (license license:lgpl2.1+)))
|
| 217 |
|
| 218 | (define-public flamegraph
|
| 219 | |
| 220 | (let ((commit "810687f180f3c4929b5d965f54817a5218c9d89b")
|
| 221 | (revision "1"))
|
| 222 | (package
|
| 223 | (name "flamegraph")
|
| 224 | (version (git-version "1.0" revision commit))
|
| 225 | (source (origin
|
| 226 | (method git-fetch)
|
| 227 | (uri (git-reference
|
| 228 | (url "https://github.com/brendangregg/FlameGraph")
|
| 229 | (commit commit)))
|
| 230 | (file-name (git-file-name name version))
|
| 231 | (sha256
|
| 232 | (base32
|
| 233 | "1lg02mxzdsm9szn4vcmx76c1bw9gqmxqk8n6v63v03036sc83s22"))))
|
| 234 | (build-system copy-build-system)
|
| 235 | (arguments
|
| 236 | `(#:install-plan
|
| 237 | ',(map (cut list <> "bin/")
|
| 238 | '("flamegraph.pl"
|
| 239 | "stackcollapse.pl"
|
| 240 | "stackcollapse-perf.pl"
|
| 241 | "stackcollapse-pmc.pl"
|
| 242 | "stackcollapse-stap.pl"
|
| 243 | "stackcollapse-instruments.pl"
|
| 244 | "stackcollapse-vtune.pl"
|
| 245 | "stackcollapse-jstack.pl"
|
| 246 | "stackcollapse-gdb.pl"
|
| 247 | "stackcollapse-go.pl"
|
| 248 | "stackcollapse-vsprof.pl"
|
| 249 | "stackcollapse-wcp.pl"))))
|
| 250 | (inputs (list perl))
|
| 251 | (home-page "http://www.brendangregg.com/flamegraphs.html")
|
| 252 | (synopsis "Stack trace visualizer")
|
| 253 | (description "Flamegraph is a collection of scripts that generate
|
| 254 | interactive SVGs out of traces genated from various tracing tools. It comes
|
| 255 | with the script @command{flamegraph.pl} and many stackcollapse scripts.")
|
| 256 | (license license:cddl1.0))))
|
| 257 |
|
| 258 | (define-public jacquesctf
|
| 259 | (let ((commit "f65127be0af2a4a3b36779f769e142e37d6a62ca")
|
| 260 | (revision "0"))
|
| 261 | (package
|
| 262 | (name "jacquesctf")
|
| 263 | (version (git-version "1.0" revision commit))
|
| 264 | (source (origin
|
| 265 | (method git-fetch)
|
| 266 | (uri (git-reference
|
| 267 | (url "https://github.com/eepp/jacquesctf")
|
| 268 | (commit commit)))
|
| 269 | (file-name (git-file-name name version))
|
| 270 | (sha256
|
| 271 | (base32
|
| 272 | "07p4xflgp6vb5fa3m78p2lxxcvardnp1m8k7mq7lpradpcxwx4rj"))))
|
| 273 | (build-system cmake-build-system)
|
| 274 | (arguments `(#:tests? #f))
|
| 275 | (inputs (list yactfr ncurses))
|
| 276 | (native-inputs (list boost))
|
| 277 | (home-page "https://github.com/eepp/jacquesctf")
|
| 278 | (synopsis "CTF inspection tool")
|
| 279 | (description "Like Jacques Cartier, Jacques CTF can explore the sea of
|
| 280 | bits of a @acronym{CTF, Common Trace Format} data stream file and discover
|
| 281 | unsuspected lands of problems within packets.")
|
| 282 | (license license:expat))))
|
| 283 |
|
| 284 | (define-public libpatch
|
| 285 | (package
|
| 286 | (name "libpatch")
|
| 287 | (version "1.0.0")
|
| 288 | (source (origin
|
| 289 | (method git-fetch)
|
| 290 | (uri (git-reference
|
| 291 | (url "https://git.sr.ht/~old/libpatch")
|
| 292 | (commit (string-append "v" version))))
|
| 293 | (file-name (git-file-name name version))
|
| 294 | (sha256
|
| 295 | (base32
|
| 296 | "1sx1sichnnqfi84z37gd04h41vpr8i2vg6yg0jkqxlrv3dys489a"))
|
| 297 | (patches (search-patches "libpatch-respect-ldflags.patch"))))
|
| 298 | (build-system gnu-build-system)
|
| 299 | (arguments
|
| 300 | `( |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | #:make-flags `("LDFLAGS=-znoexecstack" "NATIVES=")
|
| 306 | #:configure-flags
|
| 307 | (list
|
| 308 | (string-append
|
| 309 | "--target="
|
| 310 | ,(platform-linux-architecture
|
| 311 | (lookup-platform-by-target-or-system
|
| 312 | (or
|
| 313 | (%current-target-system)
|
| 314 | (%current-system))))))))
|
| 315 | |
| 316 | |
| 317 | (inputs
|
| 318 | (list capstone
|
| 319 | elfutils
|
| 320 | libunwind
|
| 321 | liburcu))
|
| 322 | (native-inputs
|
| 323 | (list coreutils
|
| 324 | |
| 325 | (list coreutils "debug")
|
| 326 | (list guile-3.0 "debug")
|
| 327 | (list gnu-make "debug")
|
| 328 |
|
| 329 | |
| 330 | (list elfutils "bin")
|
| 331 |
|
| 332 | guile-3.0
|
| 333 | gnu-make
|
| 334 | pkg-config
|
| 335 | |
| 336 | |
| 337 | zlib))
|
| 338 | (synopsis "Dynamic binary patcher")
|
| 339 | (description
|
| 340 | "libpatch is a lightweight C library that can be used by tracers,
|
| 341 | debuggers and other tools for insertion of probes in a program at runtime. It
|
| 342 | has many strategies to minimize probe overhead and maximize possible
|
| 343 | coverage.")
|
| 344 | (home-page "https://git.sr.ht/~old/libpatch")
|
| 345 | (license (list license:lgpl2.1 license:expat license:gpl3+))
|
| 346 | |
| 347 | |
| 348 | (supported-systems (list "x86_64-linux"))))
|
| 349 |
|
| 350 | (define-public lttng-ust
|
| 351 | (package
|
| 352 | (name "lttng-ust")
|
| 353 | (version "2.15.0")
|
| 354 | (source (origin
|
| 355 | (method url-fetch)
|
| 356 | (uri (string-append "https://lttng.org/files/lttng-ust/"
|
| 357 | "lttng-ust-" version ".tar.bz2"))
|
| 358 | (sha256
|
| 359 | (base32
|
| 360 | "0a1yk6cci5yqkdy3fvjdky0lc1sbpcxhpm43vb3h1pahg8y75jbb"))))
|
| 361 | (build-system gnu-build-system)
|
| 362 | (inputs
|
| 363 | (list numactl))
|
| 364 | (propagated-inputs
|
| 365 | (list liburcu)) |
| 366 | (native-inputs
|
| 367 | (list python-3 pkg-config))
|
| 368 | (home-page "https://lttng.org/")
|
| 369 | (synopsis "LTTng userspace tracer libraries")
|
| 370 | (description "The user space tracing library, liblttng-ust, is the LTTng
|
| 371 | user space tracer. It receives commands from a session daemon, for example to
|
| 372 | enable and disable specific instrumentation points, and writes event records
|
| 373 | to ring buffers shared with a consumer daemon.")
|
| 374 | (license (list license:lgpl2.1 license:expat))))
|
| 375 |
|
| 376 | (define-public lttng-tools
|
| 377 | (package
|
| 378 | (name "lttng-tools")
|
| 379 | (version "2.15.0")
|
| 380 | (source (origin
|
| 381 | (method url-fetch)
|
| 382 | (uri (string-append "https://lttng.org/files/lttng-tools/"
|
| 383 | "lttng-tools-" version ".tar.bz2"))
|
| 384 | (sha256
|
| 385 | (base32
|
| 386 | "12pjxdfqg9ri4wng143x9dvwcrx9q2kg1isv4xc1v9vdalb92wsd"))))
|
| 387 | (build-system gnu-build-system)
|
| 388 | (arguments
|
| 389 | `(#:configure-flags '("--enable-python-bindings")
|
| 390 | |
| 391 | #:tests? #f
|
| 392 | #:phases
|
| 393 | (modify-phases %standard-phases
|
| 394 | (add-before 'configure 'set-environment-variables
|
| 395 | (lambda _
|
| 396 | (setenv "HOME" "/tmp")
|
| 397 | (setenv "LTTNG_HOME" "/tmp")))
|
| 398 | |
| 399 | (add-after 'unpack 'patch-default-man-path
|
| 400 | (lambda _
|
| 401 | (substitute* "src/common/defaults.hpp"
|
| 402 | (("/usr/bin/man") "man")))))))
|
| 403 | |
| 404 | |
| 405 | |
| 406 | (inputs
|
| 407 | (list liburcu popt numactl))
|
| 408 | (propagated-inputs
|
| 409 | (list kmod module-init-tools))
|
| 410 | (native-inputs
|
| 411 | (list
|
| 412 | asciidoc
|
| 413 | babeltrace
|
| 414 | bison
|
| 415 | flex
|
| 416 | libpfm4
|
| 417 | libxml2
|
| 418 | lttng-ust
|
| 419 | perl
|
| 420 | procps
|
| 421 | python-3
|
| 422 | swig-4.0
|
| 423 | which
|
| 424 | pkg-config
|
| 425 | ))
|
| 426 | (home-page "https://lttng.org/")
|
| 427 | (synopsis "LTTng userspace tracer libraries")
|
| 428 | (description "The lttng-tools project provides a session
|
| 429 | daemon @code{lttng-sessiond} that acts as a tracing registry, the @command{lttng} command
|
| 430 | line for tracing control, a @code{lttng-ctl} library for tracing control and a
|
| 431 | @code{lttng-relayd} for network streaming.")
|
| 432 | (license (list license:gpl2 license:lgpl2.1))))
|
| 433 |
|
| 434 | (define-public perf-tools
|
| 435 | (package
|
| 436 | (name "perf-tools")
|
| 437 | (version "1.0")
|
| 438 | (source (origin
|
| 439 | (method git-fetch)
|
| 440 | (uri (git-reference
|
| 441 | (url "https://github.com/brendangregg/perf-tools")
|
| 442 | (commit (string-append "v" version))))
|
| 443 | (file-name (git-file-name name version))
|
| 444 | (sha256
|
| 445 | (base32 "1ab735idi0h62yvhzd7822jj3555vygixv4xjrfrdvi8d2hhz6qn"))))
|
| 446 | (build-system copy-build-system)
|
| 447 | (arguments
|
| 448 | `(#:phases
|
| 449 | (modify-phases %standard-phases
|
| 450 | (add-after 'unpack 'patch-file-names
|
| 451 | (lambda* (#:key inputs #:allow-other-keys)
|
| 452 | (substitute* '("execsnoop" "killsnoop" "kernel/funcslower")
|
| 453 | (("/usr/bin/gawk")
|
| 454 | (search-input-file inputs "/bin/awk")))
|
| 455 | (substitute* "execsnoop"
|
| 456 | (("/usr/bin/getconf")
|
| 457 | (search-input-file inputs "/bin/getconf"))))))
|
| 458 | #:install-plan
|
| 459 | ',(append
|
| 460 | (map (cut list <> "bin/")
|
| 461 | '("disk/bitesize"
|
| 462 | "fs/cachestat"
|
| 463 | "execsnoop"
|
| 464 | "kernel/funccount"
|
| 465 | "kernel/funcgraph"
|
| 466 | "kernel/funcslower"
|
| 467 | "kernel/functrace"
|
| 468 | "iolatency"
|
| 469 | "iosnoop"
|
| 470 | "killsnoop"
|
| 471 | "kernel/kprobe"
|
| 472 | "opensnoop"
|
| 473 | "misc/perf-stat-hist"
|
| 474 | "tools/reset-ftrace"
|
| 475 | "syscount"
|
| 476 | "net/tcpretrans"
|
| 477 | "system/tpoint"
|
| 478 | "user/uprobe"))
|
| 479 | '(("man/man8/" "share/man/man8")))))
|
| 480 | (propagated-inputs
|
| 481 | (list
|
| 482 | bash
|
| 483 | coreutils |
| 484 | gawk
|
| 485 | file
|
| 486 | perf
|
| 487 | perl
|
| 488 | procps |
| 489 | which))
|
| 490 | (home-page "https://github.com/brendangregg/perf-tools")
|
| 491 | (synopsis "Performance analysis tools")
|
| 492 | (description "Perf-tools is a collection of scripts for performance
|
| 493 | analysis and instrumentation based on Linux perf_events (aka perf) and
|
| 494 | ftrace.")
|
| 495 | (license (list license:gpl2))))
|
| 496 |
|
| 497 | (define-public systemtap
|
| 498 | (package
|
| 499 | (name "systemtap")
|
| 500 | (version "5.4")
|
| 501 | (source (origin
|
| 502 | (method url-fetch)
|
| 503 | (uri (string-append
|
| 504 | "https://sourceware.org/ftp/systemtap/releases/" name "-"
|
| 505 | version ".tar.gz"))
|
| 506 | (sha256
|
| 507 | (base32
|
| 508 | "0vibrp5chf3q0n7byg6bdv3bl6z4354dqavhywjv0xbpf5rk5yfa"))))
|
| 509 | (build-system gnu-build-system)
|
| 510 | (native-inputs (list boost cpio python python-setuptools))
|
| 511 | (inputs (list elfutils))
|
| 512 |
|
| 513 | (home-page "https://sourceware.org/systemtap/")
|
| 514 | (synopsis "GNU/Linux trace/probe tool")
|
| 515 | (description
|
| 516 | "SystemTap provides infrastructure to simplify the
|
| 517 | gathering of information about the running Linux system. This assists
|
| 518 | diagnosis of a performance or functional problem. SystemTap eliminates the
|
| 519 | need for the developer to go through the tedious and disruptive
|
| 520 | instrument, recompile, install, and reboot sequence that may be otherwise
|
| 521 | required to collect data.
|
| 522 |
|
| 523 | SystemTap provides a simple command line interface and scripting language for
|
| 524 | writing instrumentation for a live running kernel plus user-space applications.
|
| 525 | We are publishing samples, as well as enlarging the internal \"tapset\" script
|
| 526 | library to aid reuse and abstraction. SystemTap is a tool for complex
|
| 527 | tasks that may require live analysis, programmable on-line response, and
|
| 528 | whole-system symbolic access, and can also handle simple tracing jobs.")
|
| 529 | (license license:gpl2+)))
|
| 530 |
|
| 531 | (define-public uftrace
|
| 532 | (package
|
| 533 | (name "uftrace")
|
| 534 | (version "0.20")
|
| 535 | (source (origin
|
| 536 | (method git-fetch)
|
| 537 | (uri (git-reference
|
| 538 | (url "https://github.com/namhyung/uftrace")
|
| 539 | (commit (string-append "v" version))))
|
| 540 | (file-name (git-file-name name version))
|
| 541 | (sha256
|
| 542 | (base32 "0sl9y7cipyzb7c9f6d8z19yhwsmkjdgar3x32hgjyhqlaka1nb72"))
|
| 543 | (patches (search-patches "uftrace-fix-tests.patch"))))
|
| 544 | (build-system gnu-build-system)
|
| 545 | (arguments
|
| 546 | (list
|
| 547 | #:modules
|
| 548 | `((ice-9 match)
|
| 549 | ,@%default-gnu-modules)
|
| 550 | #:make-flags
|
| 551 | #~(list
|
| 552 | (string-append "CC=" #$(cc-for-target)))
|
| 553 | #:test-target "test"
|
| 554 | #:phases
|
| 555 | #~(modify-phases %standard-phases
|
| 556 | (replace 'configure
|
| 557 | (lambda* (#:key outputs target #:allow-other-keys)
|
| 558 | (let ((arch #$(platform-linux-architecture
|
| 559 | (lookup-platform-by-target-or-system
|
| 560 | (or (%current-target-system)
|
| 561 | (%current-system))))))
|
| 562 | (setenv "ARCH"
|
| 563 | (match arch
|
| 564 | ("arm64" "aarch64")
|
| 565 | (_ arch)))
|
| 566 | (when target
|
| 567 | (setenv "CROSS_COMPILE" (string-append target "-"))))
|
| 568 | (setenv "SHELL" (which "sh"))
|
| 569 | (let* ((python #$(this-package-input "python"))
|
| 570 | (luajit #$(this-package-input "luajit"))
|
| 571 | (libs (cond
|
| 572 | ((and python luajit)
|
| 573 | (list "-Wl,-rpath="
|
| 574 | python
|
| 575 | "/lib"
|
| 576 | ":"
|
| 577 | luajit
|
| 578 | "/lib"))
|
| 579 | (python (list "-Wl,-rpath=" python "/lib"))
|
| 580 | (luajit (list "-Wl,-rpath=" luajit "/lib"))
|
| 581 | (#t #f))))
|
| 582 | (when libs
|
| 583 | (setenv "LDFLAGS"
|
| 584 | (apply string-append libs))))
|
| 585 | (invoke "./configure"
|
| 586 | (string-append "--prefix="
|
| 587 | #$output))))
|
| 588 | (add-before 'check 'fix-shebang
|
| 589 | (lambda* (#:key inputs #:allow-other-keys)
|
| 590 | (substitute* "tests/t220_trace_script.py"
|
| 591 | (("/bin/sh")
|
| 592 | (search-input-file inputs "bin/sh")))))
|
| 593 | (add-before 'check 'delete-network-tests
|
| 594 | (lambda _
|
| 595 | |
| 596 | (for-each delete-file
|
| 597 | '("tests/t141_recv_basic.py"
|
| 598 | "tests/t142_recv_multi.py"
|
| 599 | "tests/t143_recv_kernel.py"
|
| 600 | "tests/t150_recv_event.py"
|
| 601 | "tests/t151_recv_runcmd.py"
|
| 602 | "tests/t167_recv_sched.py")))))))
|
| 603 | (inputs (list capstone
|
| 604 | elfutils
|
| 605 | libunwind
|
| 606 | python |
| 607 | luajit |
| 608 | ncurses))
|
| 609 | (native-inputs (list luajit pandoc pkg-config python-wrapper))
|
| 610 | (home-page "https://github.com/namhyung/uftrace")
|
| 611 | (synopsis "Function graph tracer for C/C++/Rust")
|
| 612 | (description
|
| 613 | "uftrace is a tool for tracing and analyzing the execution of
|
| 614 | programs written in C/C++. It is heavily inspired by the ftrace framework of
|
| 615 | the Linux kernel, while supporting userspace programs. It supports various
|
| 616 | kind of commands and filters to help analysis of the program execution and
|
| 617 | performance. It provides the command @command{uftrace}. By default, it is
|
| 618 | bundled with python-3 and luajit that you can delete in a package variant.")
|
| 619 | (license license:gpl2)))
|
| 620 |
|
| 621 | (define-public yactfr
|
| 622 | (let ((commit "796eaff018e2432ecc8f1f103101afafc9f38518")
|
| 623 | (revision "0"))
|
| 624 | (package
|
| 625 | (name "yactfr")
|
| 626 | (version (git-version "1.0" revision commit))
|
| 627 | (source (origin
|
| 628 | (method git-fetch)
|
| 629 | (uri (git-reference
|
| 630 | (url "https://github.com/eepp/yactfr")
|
| 631 | (commit commit)))
|
| 632 | (file-name (git-file-name name version))
|
| 633 | (sha256
|
| 634 | (base32
|
| 635 | "1p4nqsq689hr2srdvg59v9yfig2aaq9psdy6fhwnya0vszssyvn5"))))
|
| 636 | (build-system cmake-build-system)
|
| 637 | (arguments
|
| 638 | (list
|
| 639 | #:modules '((guix build cmake-build-system)
|
| 640 | ((guix build gnu-build-system) #:prefix gnu:)
|
| 641 | (guix build utils))
|
| 642 | #:phases
|
| 643 | #~(modify-phases %standard-phases
|
| 644 | (replace 'check (assoc-ref gnu:%standard-phases 'check)))))
|
| 645 | (native-inputs (list boost python-pytest-8))
|
| 646 | (home-page "https://github.com/eepp/yactfr")
|
| 647 | (synopsis "CTF reading library offering a C++14 API")
|
| 648 | (description "While the @acronym{CTF, Common Trace Format} reading
|
| 649 | libraries focus on decoding and providing completed and ordered event record
|
| 650 | objects, the yactfr API offers a lower level of CTF processing. Allowing
|
| 651 | iteration over individual element sequences to obtain elements: beginning/end
|
| 652 | of packet, beginning/end of event record, beggining/end of structure,
|
| 653 | individual data stream scalar values like fixed-length integers, fixed-length
|
| 654 | floating point numbers, and null-terminated strings, specific clock value
|
| 655 | update, known data stream ID, and the rest.")
|
| 656 | (license license:expat))))
|