diff mbox series

[bug#50756] gnu: Add lttng-tools.

Message ID 20210923124004.3164-1-olivier.dion@polymtl.ca
State Accepted
Headers show
Series [bug#50756] gnu: Add lttng-tools. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Olivier Dion Sept. 23, 2021, 12:40 p.m. UTC
* gnu/packages/linux.scm (lttng-tools): New variable.

Note that tests are not yet working.

Signed-off-by: Olivier Dion <olivier.dion@polymtl.ca>
---
 gnu/packages/linux.scm | 54 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Comments

Xinglu Chen Sept. 24, 2021, 2:24 p.m. UTC | #1
On Thu, Sep 23 2021, Olivier Dion via Guix-patches via wrote:

> * gnu/packages/linux.scm (lttng-tools): New variable.
>
> Note that tests are not yet working.

What is the reason for that?  There should be a comment explaining why.

> Signed-off-by: Olivier Dion <olivier.dion@polymtl.ca>

There is no need to “sign-off” your own commit; this is only done by
committers who push a patch on behalf of someone else.

> ---
>  gnu/packages/linux.scm | 54 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 9bb90e599e..a8cb4fd05a 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -53,6 +53,7 @@
>  ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
>  ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
>  ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
> +;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -8051,6 +8052,59 @@ enable and disable specific instrumentation points, and writes event records
>  to ring buffers shared with a consumer daemon.")
>      (license license:lgpl2.1+)))
>  
> +(define-public lttng-tools
> +  (package
> +    (name "lttng-tools")
> +    (version "2.12.5")

Version 2.13 is available; any reason for not using it?

> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://lttng.org/files/lttng-tools/"
> +                                  "lttng-tools-" version ".tar.bz2"))
> +              (sha256
> +               (base32 "0bgk35423v6z17j1w80m7dcza7gigs1pwyq24sdmgqwg6j2d1zmc"))))

Keep lines <=80 characters long.

> +
> +    (build-system gnu-build-system)

These newlines aren’t necessary.

> +    (arguments
> +     `(#:tests? #f
> +       #:parallel-tests? #f

There is no need to set #:parallel-tests? if #:tests? is set to #f.

> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'configure 'set-environment-variables
> +           (lambda _
> +             (setenv "HOME" "/tmp")
> +             (setenv "LTTNG_HOME" "/tmp"))))))
> +
> +    (inputs
> +     `(("liburcu" ,liburcu)
> +       ("popt" ,popt)
> +       ("numactl" ,numactl)))
> +
> +    (propagated-inputs
> +     `(("libkmod" ,kmod)
> +       ("modprobe" ,module-init-tools)))

Any reason for the labels not being the same as the package?

> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)
> +       ("perl" ,perl)
> +       ("libpfm4" ,libpfm4)
> +       ("python" ,python-3)

While running the configure script, I get

  configure: You may configure with --enable-python-bindings if you want Python bindings.

So you would have to pass the ‘--enable-python-bindings’ flag, and
Python would be needed during runtime as well.

> +       ("procps" ,procps)
> +       ("which" ,which)
> +       ("flex" ,flex)
> +       ("bison" ,bison)
> +       ("asciidoc" ,asciidoc)
> +       ("libxml2" ,libxml2)
> +       ("lttng-ust" ,lttng-ust)))
>
> +    (home-page "https://lttng.org/")
> +    (synopsis "LTTng userspace tracer libraries")
> +    (description "The lttng-tools project provides a session
> +daemon (lttng-sessiond) that acts as a tracing registry, the \"lttng\" command

the @command{lttng} command

> +line for tracing control, a lttng-ctl library for tracing control and a
> +lttng-relayd for network streaming.")

I would use @code{lttng-ctl} and @code{lttng-relayd}.

> +    (license license:gpl2)))

The bottom of the homepage says

  …LTTng-tools is licensed under LGPLv2.1 and GPLv2…

so it would be (list license:gpl2 license:lgpl2.1)

Could you send an updated patch?

[1]: <https://lttng.org/docs/v2.13/#doc-building-from-source>
Olivier Dion Sept. 24, 2021, 3:13 p.m. UTC | #2
On Fri, 24 Sep 2021, Xinglu Chen <public@yoctocell.xyz> wrote:
> On Thu, Sep 23 2021, Olivier Dion via Guix-patches via wrote:

>> +(define-public lttng-tools
>> +  (package
>> +    (name "lttng-tools")
>> +    (version "2.12.5")
>
> Version 2.13 is available; any reason for not using it?

Would require to bump version of lttng-ust also I think.  I prefer to do all of this
in another patch.  

>> +    (arguments
>> +     `(#:tests? #f
>> +       #:parallel-tests? #f
>
> There is no need to set #:parallel-tests? if #:tests? is set to #f.

During my testing, I noticed that test in parallel are not working
because of how the lttng-daemon works.  So I disable the parallel option
in order to not forget it when testing will work in the future.  I
should probably add a comment to explain the rationale here.

>> +    (propagated-inputs
>> +     `(("libkmod" ,kmod)
>> +       ("modprobe" ,module-init-tools)))
>
> Any reason for the labels not being the same as the package?

I follow the naming convention in the description of the project's README
so it's easier to map the dependencies described by it to Guix's
packages.  I can change this, but I find it more clear that way.

>
>> +    (native-inputs
>> +     `(("pkg-config" ,pkg-config)
>> +       ("perl" ,perl)
>> +       ("libpfm4" ,libpfm4)
>> +       ("python" ,python-3)
>
> While running the configure script, I get
>
>   configure: You may configure with --enable-python-bindings if you want Python bindings.
>
> So you would have to pass the ‘--enable-python-bindings’ flag, and
> Python would be needed during runtime as well.

Does it tho?  Bindings can be generated at build time. While you would
require python-3 at runtime to use the bindings, you don't require
python-3 to use the other tools of the project.  I don't mind adding it
to the inputs, I'm just asking.

> Could you send an updated patch?

Will do soon!
Xinglu Chen Sept. 26, 2021, 9:42 a.m. UTC | #3
On Fri, Sep 24 2021, Olivier Dion via Guix-patches via wrote:

> On Fri, 24 Sep 2021, Xinglu Chen <public@yoctocell.xyz> wrote:
>> On Thu, Sep 23 2021, Olivier Dion via Guix-patches via wrote:
>
>>> +(define-public lttng-tools
>>> +  (package
>>> +    (name "lttng-tools")
>>> +    (version "2.12.5")
>>
>> Version 2.13 is available; any reason for not using it?
>
> Would require to bump version of lttng-ust also I think.  I prefer to do all of this
> in another patch.

Ah, OK.

>>> +    (arguments
>>> +     `(#:tests? #f
>>> +       #:parallel-tests? #f
>>
>> There is no need to set #:parallel-tests? if #:tests? is set to #f.
>
> During my testing, I noticed that test in parallel are not working
> because of how the lttng-daemon works.  So I disable the parallel option
> in order to not forget it when testing will work in the future.  I
> should probably add a comment to explain the rationale here.
>
>>> +    (propagated-inputs
>>> +     `(("libkmod" ,kmod)
>>> +       ("modprobe" ,module-init-tools)))
>>
>> Any reason for the labels not being the same as the package?
>
> I follow the naming convention in the description of the project's README
> so it's easier to map the dependencies described by it to Guix's
> packages.  I can change this, but I find it more clear that way.

The name of the label is usually the same as the package, so I would
change them to “kmod” and “module-init-tools” respectively.

>>
>>> +    (native-inputs
>>> +     `(("pkg-config" ,pkg-config)
>>> +       ("perl" ,perl)
>>> +       ("libpfm4" ,libpfm4)
>>> +       ("python" ,python-3)
>>
>> While running the configure script, I get
>>
>>   configure: You may configure with --enable-python-bindings if you want Python bindings.
>>
>> So you would have to pass the ‘--enable-python-bindings’ flag, and
>> Python would be needed during runtime as well.
>
> Does it tho?  Bindings can be generated at build time. While you would
> require python-3 at runtime to use the bindings, you don't require
> python-3 to use the other tools of the project.  I don't mind adding it
> to the inputs, I'm just asking.

True, the user can install always install Python in their profile
themselves.
Ludovic Courtès Oct. 13, 2021, 8:52 a.m. UTC | #4
Hi Olivier,

Did you have a chance to look into this?

  https://issues.guix.gnu.org/50756

TIA!

Ludo’.

Xinglu Chen <public@yoctocell.xyz> skribis:

> On Fri, Sep 24 2021, Olivier Dion via Guix-patches via wrote:
>
>> On Fri, 24 Sep 2021, Xinglu Chen <public@yoctocell.xyz> wrote:
>>> On Thu, Sep 23 2021, Olivier Dion via Guix-patches via wrote:
>>
>>>> +(define-public lttng-tools
>>>> +  (package
>>>> +    (name "lttng-tools")
>>>> +    (version "2.12.5")
>>>
>>> Version 2.13 is available; any reason for not using it?
>>
>> Would require to bump version of lttng-ust also I think.  I prefer to do all of this
>> in another patch.
>
> Ah, OK.
>
>>>> +    (arguments
>>>> +     `(#:tests? #f
>>>> +       #:parallel-tests? #f
>>>
>>> There is no need to set #:parallel-tests? if #:tests? is set to #f.
>>
>> During my testing, I noticed that test in parallel are not working
>> because of how the lttng-daemon works.  So I disable the parallel option
>> in order to not forget it when testing will work in the future.  I
>> should probably add a comment to explain the rationale here.
>>
>>>> +    (propagated-inputs
>>>> +     `(("libkmod" ,kmod)
>>>> +       ("modprobe" ,module-init-tools)))
>>>
>>> Any reason for the labels not being the same as the package?
>>
>> I follow the naming convention in the description of the project's README
>> so it's easier to map the dependencies described by it to Guix's
>> packages.  I can change this, but I find it more clear that way.
>
> The name of the label is usually the same as the package, so I would
> change them to “kmod” and “module-init-tools” respectively.
>
>>>
>>>> +    (native-inputs
>>>> +     `(("pkg-config" ,pkg-config)
>>>> +       ("perl" ,perl)
>>>> +       ("libpfm4" ,libpfm4)
>>>> +       ("python" ,python-3)
>>>
>>> While running the configure script, I get
>>>
>>>   configure: You may configure with --enable-python-bindings if you want Python bindings.
>>>
>>> So you would have to pass the ‘--enable-python-bindings’ flag, and
>>> Python would be needed during runtime as well.
>>
>> Does it tho?  Bindings can be generated at build time. While you would
>> require python-3 at runtime to use the bindings, you don't require
>> python-3 to use the other tools of the project.  I don't mind adding it
>> to the inputs, I'm just asking.
>
> True, the user can install always install Python in their profile
> themselves.
Olivier Dion Oct. 13, 2021, 2:41 p.m. UTC | #5
On Wed, 13 Oct 2021, Ludovic Courtès <ludo@gnu.org> wrote:
> Hi Olivier,
>
> Did you have a chance to look into this?
>
>   https://issues.guix.gnu.org/50756
>
> TIA!
>
> Ludo’.

Hi Ludo,

Sorry I'm over the head with the university right now.  I will try to
send my updated patch this weekend! :-)
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9bb90e599e..a8cb4fd05a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -53,6 +53,7 @@ 
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
+;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8051,6 +8052,59 @@  enable and disable specific instrumentation points, and writes event records
 to ring buffers shared with a consumer daemon.")
     (license license:lgpl2.1+)))
 
+(define-public lttng-tools
+  (package
+    (name "lttng-tools")
+    (version "2.12.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://lttng.org/files/lttng-tools/"
+                                  "lttng-tools-" version ".tar.bz2"))
+              (sha256
+               (base32 "0bgk35423v6z17j1w80m7dcza7gigs1pwyq24sdmgqwg6j2d1zmc"))))
+
+    (build-system gnu-build-system)
+
+    (arguments
+     `(#:tests? #f
+       #:parallel-tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'set-environment-variables
+           (lambda _
+             (setenv "HOME" "/tmp")
+             (setenv "LTTNG_HOME" "/tmp"))))))
+
+    (inputs
+     `(("liburcu" ,liburcu)
+       ("popt" ,popt)
+       ("numactl" ,numactl)))
+
+    (propagated-inputs
+     `(("libkmod" ,kmod)
+       ("modprobe" ,module-init-tools)))
+
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("perl" ,perl)
+       ("libpfm4" ,libpfm4)
+       ("python" ,python-3)
+       ("procps" ,procps)
+       ("which" ,which)
+       ("flex" ,flex)
+       ("bison" ,bison)
+       ("asciidoc" ,asciidoc)
+       ("libxml2" ,libxml2)
+       ("lttng-ust" ,lttng-ust)))
+
+    (home-page "https://lttng.org/")
+    (synopsis "LTTng userspace tracer libraries")
+    (description "The lttng-tools project provides a session
+daemon (lttng-sessiond) that acts as a tracing registry, the \"lttng\" command
+line for tracing control, a lttng-ctl library for tracing control and a
+lttng-relayd for network streaming.")
+    (license license:gpl2)))
+
 (define-public kexec-tools
   (package
     (name "kexec-tools")