Subject: Re: bug#26256: [PATCH 4/6] gnu: fio: Enable rbd support.

From: Marius Bakke <[email-masked]>
Date: Tue, 28 Mar 2017 00:10:57 +0200

Ludovic Courtès <[email-masked]> writes:

> Marius Bakke <[email-masked]> skribis:
>
>> * gnu/packages/benchmark.scm (fio)[inputs]: Add ceph:lib.
>
> Would be worth checking how this affects the closure size.  It’s a
> developer tool though, so I’d argue that it’s less of a problem if the
> closure size is increased noticeably in this cases.

ceph:lib increases fios closure size from 452.3 MiB to a good 738 MiB.

However, by moving the fio auxiliary scripts to a separate output, I
managed to get the baseline size down from 452.3 MiB to 75.3 MiB. See
attached patch. WDYT?

From b942036bef17a4eacfd7406a9a5130fd2255252d Mon Sep 17 00:00:00 2001
From: Marius Bakke <[email-masked]>
Date: Tue, 28 Mar 2017 00:08:36 +0200
Subject: [PATCH] gnu: fio: Install python scripts in separate output.

* gnu/packages/benchmark.scm (fio)[outputs]: New field.
[arguments]: Rename 'wrap-python-scripts' to 'move-outputs'. Keep wrapper.
---
 gnu/packages/benchmark.scm | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index ff5715d57..994bf1db2 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -64,13 +64,22 @@
              (let ((out (assoc-ref outputs "out")))
                (zero? (system* "./configure"
                                (string-append "--prefix=" out))))))
-         (add-after
-          'install 'wrap-python-scripts
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let ((out (assoc-ref outputs "out")))
-              (wrap-program (string-append out "/bin/fiologparser_hist.py")
-                `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
-              #t))))))
+         (add-after 'install 'move-outputs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (utils (string-append (assoc-ref outputs "utils") "/bin")))
+               (mkdir-p utils)
+               (for-each (lambda (file)
+                           (let ((src (string-append out "/bin/" file))
+                                 (dst (string-append utils "/" file)))
+                             (link src dst)
+                             (delete-file src)))
+                         '("fio2gnuplot" "fio_latency2csv.py"
+                           "fiologparser_hist.py" "fiologparser.py"))
+               (wrap-program (string-append utils "/fiologparser_hist.py")
+                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
+               #t))))))
+    (outputs '("out" "utils"))
     (inputs
      `(("libaio" ,libaio)
        ("gnuplot" ,gnuplot)
-- 
2.12.2