* [bug#40083] [PATCH] gnu: Add blktrace.
@ 2020-03-15 20:52 Vincent Legoll
2020-03-15 21:00 ` Vincent Legoll
2020-03-20 21:52 ` [bug#40083] cleanups submitted upstream Vincent Legoll
0 siblings, 2 replies; 10+ messages in thread
From: Vincent Legoll @ 2020-03-15 20:52 UTC (permalink / raw)
To: 40083
[-- Attachment #1: Type: text/plain, Size: 64 bytes --]
Lightly tested on qemu VM, seems working OK
--
Vincent Legoll
[-- Attachment #2: 0001-gnu-Add-blktrace.patch --]
[-- Type: text/x-patch, Size: 2019 bytes --]
From 016265a4594239a9fa3f98031b0d89397b89cfe3 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sun, 15 Mar 2020 21:25:54 +0100
Subject: [PATCH] gnu: Add blktrace.
* gnu/packages/linux.scm (blktrace): New variable.
---
gnu/packages/linux.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index fda7570d89..4d966a2cad 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4013,6 +4013,37 @@ system calls, important for the performance of databases and other advanced
applications.")
(license license:lgpl2.1+)))
+(define-public blktrace
+ (let ((commit "f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc")
+ (revision "0"))
+ (package
+ (name "blktrace")
+ (version (git-version "1.2.0" revision commit))
+ (home-page
+ "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit commit)))
+ (sha256
+ (base32 "1ihdfimg7mfcgdm6l09xfqx5kdyv42x743dxp3z3w65q5vd7xy89"))
+ (file-name (git-file-name name version))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:make-flags
+ (list "CC=gcc" (string-append "prefix=" %output))
+ #:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases (delete 'configure)))) ; no configure script
+ (inputs
+ `(("libaio" ,libaio)))
+ (synopsis "Block layer IO tracing mechanism")
+ (description "Blktrace is a block layer IO tracing mechanism which provides
+detailed information about request queue operations to user space. It extracts
+event traces from the kernel (via the relaying through the debug file system).")
+ (license license:gpl2))))
+
(define-public sbc
(package
(name "sbc")
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-15 20:52 [bug#40083] [PATCH] gnu: Add blktrace Vincent Legoll
@ 2020-03-15 21:00 ` Vincent Legoll
2020-03-15 21:47 ` Vincent Legoll
2020-03-20 21:52 ` [bug#40083] cleanups submitted upstream Vincent Legoll
1 sibling, 1 reply; 10+ messages in thread
From: Vincent Legoll @ 2020-03-15 21:00 UTC (permalink / raw)
To: 40083
The use of git instead of released tarball is to have the commit for
fixing CVE-2018-10689
--
Vincent Legoll
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-15 21:00 ` Vincent Legoll
@ 2020-03-15 21:47 ` Vincent Legoll
2020-03-19 14:04 ` Ludovic Courtès
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Legoll @ 2020-03-15 21:47 UTC (permalink / raw)
To: 40083
Dunno what to do about the packaged .py scripts, Should I patch the
shebang ? ("#! /usr/bin/env python") after adding python to inputs ?
On Sun, Mar 15, 2020 at 10:00 PM Vincent Legoll
<vincent.legoll@gmail.com> wrote:
>
> The use of git instead of released tarball is to have the commit for
> fixing CVE-2018-10689
>
> --
> Vincent Legoll
--
Vincent Legoll
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-15 21:47 ` Vincent Legoll
@ 2020-03-19 14:04 ` Ludovic Courtès
2020-03-19 15:05 ` Vincent Legoll
0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2020-03-19 14:04 UTC (permalink / raw)
To: Vincent Legoll; +Cc: 40083
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Hi!
Vincent Legoll <vincent.legoll@gmail.com> skribis:
> Dunno what to do about the packaged .py scripts, Should I patch the
> shebang ? ("#! /usr/bin/env python") after adding python to inputs ?
Just do something like this:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 661 bytes --]
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d19c20d056..0822748968 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4036,7 +4036,8 @@ applications.")
#:phases
(modify-phases %standard-phases (delete 'configure)))) ; no configure script
(inputs
- `(("libaio" ,libaio)))
+ `(("libaio" ,libaio)
+ ("python" ,python-wrapper))) ;for 'bno_plot.py'
(synopsis "Block layer IO tracing mechanism")
(description "Blktrace is a block layer IO tracing mechanism which provides
detailed information about request queue operations to user space. It extracts
[-- Attachment #3: Type: text/plain, Size: 262 bytes --]
and the .py files will be automatically patched.
However, ‘bno_plot.py’ refers to /bin/rm and gnuplot, and these
references should probably be replaced with absolute file names.
Could you take a look and send an updated patch?
Thanks,
Ludo’.
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-19 14:04 ` Ludovic Courtès
@ 2020-03-19 15:05 ` Vincent Legoll
2020-03-19 15:48 ` Marius Bakke
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Legoll @ 2020-03-19 15:05 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 40083
Hello,
On Thu, Mar 19, 2020 at 3:05 PM Ludovic Courtès <ludo@gnu.org> wrote:
> Vincent Legoll <vincent.legoll@gmail.com> skribis:
>
> > Dunno what to do about the packaged .py scripts, Should I patch the
> > shebang ? ("#! /usr/bin/env python") after adding python to inputs ?
>
> Just do something like this:
[something's missing here] ;-)
> and the .py files will be automatically patched.
>
> However, ‘bno_plot.py’ refers to /bin/rm and gnuplot, and these
> references should probably be replaced with absolute file names.
>
> Could you take a look and send an updated patch?
I already have that patched out, replacing that rm call with pure
python code, I'll resubmit a new version correcting all those glitches
later.
Now's time for a bit of sunlight to placebo-help fight covid...
--
Vincent Legoll
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-19 15:05 ` Vincent Legoll
@ 2020-03-19 15:48 ` Marius Bakke
2020-03-19 16:01 ` Vincent Legoll
0 siblings, 1 reply; 10+ messages in thread
From: Marius Bakke @ 2020-03-19 15:48 UTC (permalink / raw)
To: Vincent Legoll, Ludovic Courtès; +Cc: 40083
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
Vincent Legoll <vincent.legoll@gmail.com> writes:
> Hello,
>
> On Thu, Mar 19, 2020 at 3:05 PM Ludovic Courtès <ludo@gnu.org> wrote:
>> Vincent Legoll <vincent.legoll@gmail.com> skribis:
>>
>> > Dunno what to do about the packaged .py scripts, Should I patch the
>> > shebang ? ("#! /usr/bin/env python") after adding python to inputs ?
>>
>> Just do something like this:
>
> [something's missing here] ;-)
Hm? There is an inline patch. It renders nicely in my mail client, as
well as on issues.guix.gnu.org:
https://issues.guix.gnu.org/issue/40083#3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-19 15:48 ` Marius Bakke
@ 2020-03-19 16:01 ` Vincent Legoll
2020-03-19 17:25 ` Vincent Legoll
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Legoll @ 2020-03-19 16:01 UTC (permalink / raw)
To: Marius Bakke; +Cc: 40083, Ludovic Courtès
On Thu, Mar 19, 2020 at 4:48 PM Marius Bakke <mbakke@fastmail.com> wrote:
> Vincent Legoll <vincent.legoll@gmail.com> writes:
> > [something's missing here] ;-)
>
> Hm? There is an inline patch. It renders nicely in my mail client, as
> well as on issues.guix.gnu.org:
>
> https://issues.guix.gnu.org/issue/40083#3
Yes, I've seen it on the guix issues site, but gmail is not showing it
properly...
--
Vincent Legoll
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] [PATCH] gnu: Add blktrace.
2020-03-19 16:01 ` Vincent Legoll
@ 2020-03-19 17:25 ` Vincent Legoll
2020-03-20 17:35 ` bug#40083: " Marius Bakke
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Legoll @ 2020-03-19 17:25 UTC (permalink / raw)
To: Marius Bakke; +Cc: 40083, Ludovic Courtès
[-- Attachment #1: Type: text/plain, Size: 705 bytes --]
Is that better ?
I intend to submit the rmtree patch (along a bunch of other cleanups)
to upstream, will update guix packaging when that will happen...
On Thu, Mar 19, 2020 at 5:01 PM Vincent Legoll <vincent.legoll@gmail.com> wrote:
>
> On Thu, Mar 19, 2020 at 4:48 PM Marius Bakke <mbakke@fastmail.com> wrote:
> > Vincent Legoll <vincent.legoll@gmail.com> writes:
> > > [something's missing here] ;-)
> >
> > Hm? There is an inline patch. It renders nicely in my mail client, as
> > well as on issues.guix.gnu.org:
> >
> > https://issues.guix.gnu.org/issue/40083#3
>
> Yes, I've seen it on the guix issues site, but gmail is not showing it
> properly...
>
> --
> Vincent Legoll
--
Vincent Legoll
[-- Attachment #2: 0001-gnu-Add-blktrace-v2.patch --]
[-- Type: text/x-patch, Size: 4826 bytes --]
From 262d13d62b85bc62dfb2b0aa888d621081b8fa65 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.legoll@gmail.com>
Date: Sun, 15 Mar 2020 21:25:54 +0100
Subject: [PATCH] gnu: Add blktrace.
* gnu/packages/linux.scm (blktrace): New variable.
* gnu/packages/patches/blktrace-use-rmtree.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 2 +
gnu/packages/linux.scm | 41 +++++++++++++++++++
.../patches/blktrace-use-rmtree.patch | 32 +++++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 gnu/packages/patches/blktrace-use-rmtree.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index ca3f2664aa..28731ecc46 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -27,6 +27,7 @@
# Copyright © 2019 Brett Gilio <brettg@gnu.org>
# Copyright © 2019 Amin Bandali <mab@gnu.org>
# Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
+# Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
#
# This file is part of GNU Guix.
#
@@ -766,6 +767,7 @@ dist_patch_DATA = \
%D%/packages/patches/binutils-loongson-workaround.patch \
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
%D%/packages/patches/blender-2.79-python-3.7-fix.patch \
+ %D%/packages/patches/blktrace-use-rmtree.patch \
%D%/packages/patches/bluez-CVE-2020-0556.patch \
%D%/packages/patches/byobu-writable-status.patch \
%D%/packages/patches/calibre-no-updates-dialog.patch \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0e649d0fe3..719ed7cad9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4012,6 +4012,47 @@ system calls, important for the performance of databases and other advanced
applications.")
(license license:lgpl2.1+)))
+(define-public blktrace
+ (let ((commit "f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc")
+ (revision "0"))
+ (package
+ (name "blktrace")
+ (version (git-version "1.2.0" revision commit))
+ (home-page
+ "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit commit)))
+ (sha256
+ (base32 "1ihdfimg7mfcgdm6l09xfqx5kdyv42x743dxp3z3w65q5vd7xy89"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "blktrace-use-rmtree.patch"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:make-flags
+ (list "CC=gcc" (string-append "prefix=" %output))
+ #:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (add-after 'unpack 'fix-gnuplot-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gnuplot (assoc-ref inputs "gnuplot")))
+ (substitute* "btt/bno_plot.py"
+ (("gnuplot %s")
+ (string-append gnuplot "/bin/gnuplot %s")))))))))
+ (inputs
+ `(("libaio" ,libaio)
+ ("gnuplot" ,gnuplot)
+ ("python" ,python-wrapper))) ;for 'bno_plot.py'
+ (synopsis "Block layer IO tracing mechanism")
+ (description "Blktrace is a block layer IO tracing mechanism which provides
+detailed information about request queue operations to user space. It extracts
+event traces from the kernel (via the relaying through the debug file system).")
+ (license license:gpl2))))
+
(define-public sbc
(package
(name "sbc")
diff --git a/gnu/packages/patches/blktrace-use-rmtree.patch b/gnu/packages/patches/blktrace-use-rmtree.patch
new file mode 100644
index 0000000000..bb0a10da72
--- /dev/null
+++ b/gnu/packages/patches/blktrace-use-rmtree.patch
@@ -0,0 +1,32 @@
+From 6d1ce4a3a1a561644695a50c00cbd28494728061 Mon Sep 17 00:00:00 2001
+From: Vincent Legoll <vincent.legoll@gmail.com>
+Date: Mon, 16 Mar 2020 11:43:19 +0100
+Subject: [PATCH 02/10] bno_plot.py: Use shutil.rmtree() instead of
+ os.system('/bin/rm')
+
+---
+ btt/bno_plot.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/btt/bno_plot.py b/btt/bno_plot.py
+index f05cfdc..36fc524 100644
+--- a/btt/bno_plot.py
++++ b/btt/bno_plot.py
+@@ -40,7 +40,7 @@ To exit the plotter, enter 'quit' or ^D at the 'gnuplot> ' prompt.
+
+ from __future__ import absolute_import
+ from __future__ import print_function
+-import getopt, glob, os, sys, tempfile
++import getopt, glob, os, sys, tempfile, shutil
+
+ verbose = 0
+ cmds = """
+@@ -125,4 +125,4 @@ if __name__ == '__main__':
+ sys.exit(1)
+
+ os.waitpid(pid, 0)
+- os.system('/bin/rm -rf ' + tmpdir)
++ shutil.rmtree(tmpdir)
+--
+2.20.1
+
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#40083: [PATCH] gnu: Add blktrace.
2020-03-19 17:25 ` Vincent Legoll
@ 2020-03-20 17:35 ` Marius Bakke
0 siblings, 0 replies; 10+ messages in thread
From: Marius Bakke @ 2020-03-20 17:35 UTC (permalink / raw)
To: Vincent Legoll; +Cc: 40083-done, Ludovic Courtès
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
Vincent Legoll <vincent.legoll@gmail.com> writes:
> Is that better ?
LGTM.
> I intend to submit the rmtree patch (along a bunch of other cleanups)
> to upstream, will update guix packaging when that will happen...
Great!
[...]
> +(define-public blktrace
> + (let ((commit "f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc")
> + (revision "0"))
I added a comment about why we take this commit instead of the latest
tagged version.
[...]
> + (add-after 'unpack 'fix-gnuplot-path
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((gnuplot (assoc-ref inputs "gnuplot")))
> + (substitute* "btt/bno_plot.py"
> + (("gnuplot %s")
> + (string-append gnuplot "/bin/gnuplot %s")))))))))
...and ended this phase on a #t.
Applied!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [bug#40083] cleanups submitted upstream
2020-03-15 20:52 [bug#40083] [PATCH] gnu: Add blktrace Vincent Legoll
2020-03-15 21:00 ` Vincent Legoll
@ 2020-03-20 21:52 ` Vincent Legoll
1 sibling, 0 replies; 10+ messages in thread
From: Vincent Legoll @ 2020-03-20 21:52 UTC (permalink / raw)
To: 40083
If/when the following series is merged, we will be able to remove the
local patch...
https://www.spinics.net/lists/linux-btrace/msg01154.html
--
Vincent Legoll
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-03-20 21:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-15 20:52 [bug#40083] [PATCH] gnu: Add blktrace Vincent Legoll
2020-03-15 21:00 ` Vincent Legoll
2020-03-15 21:47 ` Vincent Legoll
2020-03-19 14:04 ` Ludovic Courtès
2020-03-19 15:05 ` Vincent Legoll
2020-03-19 15:48 ` Marius Bakke
2020-03-19 16:01 ` Vincent Legoll
2020-03-19 17:25 ` Vincent Legoll
2020-03-20 17:35 ` bug#40083: " Marius Bakke
2020-03-20 21:52 ` [bug#40083] cleanups submitted upstream Vincent Legoll
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.