From 2690b6ce7da78eda4d936e3344fc6684a176ac81 Mon Sep 17 00:00:00 2001 From: Rouby Pierre-Antoine Date: Fri, 20 Apr 2018 17:30:57 +0200 Subject: [PATCH] gnu: Add libpfm4. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/linux.scm (libpfm4): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/linux.scm | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 8fc9c56d69..4d24463173 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4680,3 +4680,50 @@ (define-public psm2 ;; Only the x86_64 architecure is supported. (supported-systems '("x86_64-linux")) (license (list license:bsd-3 license:gpl2)))) ; dual + +(define-public libpfm4 + (package + (name "libpfm4") + (version "4.9.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/perfmon2/" + name "/libpfm-" version ".tar.gz")) + (sha256 + (base32 + "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv")))) + (build-system gnu-build-system) + (arguments + '(#:modules ((guix build utils) + (guix build gnu-build-system)) + #:phases (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'build + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (setenv "CC" "gcc") + (invoke "make") + #t))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (invoke "make" + (string-append "PREFIX=" out) + "install") + #t)))))) + (synopsis "Performance event monitoring library") + (description + "This package provides a library called libpfm4, which is used to develop +monitoring tools exploiting the performance monitoring events such as those +provided by the Performance Monitoring Unit (PMU) of modern processors. + +Libpfm4 helps convert from an event name, expressed as a string, to the event +encoding that is either the raw event as documented by the hardware vendor or +the OS-specific encoding. In the latter case, the library is able to prepare +the OS-specific data structures needed by the kernel to setup the event. + +libpfm4 provides support for the @code{perf_events} interface, which was +introduced in Linux 2.6.31.") + (home-page "http://perfmon2.sourceforge.net/") + (license license:expat)))