• [gentoo-dev] [PATCH] profiles: create USE=valgrind global USE flag

    From Sam James@21:1/5 to All on Sun May 14 10:30:01 2023
    This always has the same meaning in packages - build in annotations to help with e.g. custom memory allocators to reduce noise and improve Valgrind's accuracy.

    All invalid uses of this were already fixed (cases where it was used to control running the testsuite under Valgrind which we don't want to do, it's too flaky under sandbox & not reliable with diff arches.)

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    profiles/use.desc | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index 04ca8e845ccd9..675fd291fee22 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # Keep them sorted
    @@ -333,6 +333,7 @@ usb - Add USB support to applications that have optional USB support (e.g. cups)
    v4l - Enable support for video4linux (using linux-headers or userspace libv4l libraries)
    vaapi - Enable Video Acceleration API for hardware decoding
    vala - Enable bindings for dev-lang/vala
    +valgrind - Enable annotations for accuracy. May slow down runtime slightly. Safe to use even if not currently using dev-util/valgrind
    vanilla - Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
    vcd - Video CD supp
  • From David Seifert@21:1/5 to Sam James on Sun May 14 18:50:01 2023
    On Sun, 2023-05-14 at 09:26 +0100, Sam James wrote:
    This always has the same meaning in packages - build in annotations to
    help
    with e.g. custom memory allocators to reduce noise and improve
    Valgrind's accuracy.

    All invalid uses of this were already fixed (cases where it was used
    to control
    running the testsuite under Valgrind which we don't want to do, it's
    too flaky
    under sandbox & not reliable with diff arches.)

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
     profiles/use.desc | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index 04ca8e845ccd9..675fd291fee22 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
     # Distributed under the terms of the GNU General Public License v2
     
     # Keep them sorted
    @@ -333,6 +333,7 @@ usb - Add USB support to applications that have
    optional USB support (e.g. cups)
     v4l - Enable support for video4linux (using linux-headers or
    userspace libv4l libraries)
     vaapi - Enable Video Acceleration API for hardware decoding
     vala - Enable bindings for dev-lang/vala
    +valgrind - Enable annotations for accuracy. May slow down runtime
    slightly. Safe to use even if not currently using dev-util/valgrind
     vanilla - Do not add extra patches which change default behaviour; DO
    NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
     vcd - Video CD support
     vdpau - Enable the Video Decode and Presentation API for Unix
    acceleration interface

    yes please, lgtm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arsen =?utf-8?Q?Arsenovi=C4=87?=@21:1/5 to Sam James on Sun May 14 18:50:01 2023
    Sam James <sam@gentoo.org> writes:

    This always has the same meaning in packages - build in annotations to help with e.g. custom memory allocators to reduce noise and improve Valgrind's accuracy.

    All invalid uses of this were already fixed (cases where it was used to control
    running the testsuite under Valgrind which we don't want to do, it's too flaky
    under sandbox & not reliable with diff arches.)

    LGTM. thanks!

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    profiles/use.desc | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index 04ca8e845ccd9..675fd291fee22 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # Keep them sorted
    @@ -333,6 +333,7 @@ usb - Add USB support to applications that have optional USB support (e.g. cups)
    v4l - Enable support for video4linux (using linux-headers or userspace libv4l libraries)
    vaapi - Enable Video Acceleration API for hardware decoding
    vala - Enable bindings for dev-lang/vala
    +valgrind - Enable annotations for accuracy. May slow down runtime
    slightly. Safe to use even if not currently using dev-util/valgrind
    vanilla - Do not add extra patches which change default behaviour; DO NOT USE
    THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
    vcd - Video CD support
    vdpau - Enable the Video Decode and Presentation API for Unix acceleration interface


    --
    Arsen Arsenović

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iOcEARYKAI8WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZGEQWV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxEcYXJzZW5AZ2Vu dG9vLm9yZwAKCRBSwpQwHqLEkxB7AQCYaYfoULfeimBkmKlJP9KPCLBHDsTDfel+ l/WX+PrnfQD/bps/NvdhfKR00O6rhHIizlDh3YcKiCSVYAu6jC/PhgA=5IF4
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Alexe Stefan on Sun May 14 20:30:01 2023
    Alexe Stefan <stefanalexe48@gmail.com> writes:

    Does enabling USE=valgrind impact runtime performance in any way?

    A very small amount because it adds a check at runtime for whether
    the application is running under Valgrind. The compiler may be able
    to optimise this a bit if it can determine it's unlikely (if the
    Valgrind headers don't already do this, they should probably mark
    them as cold functions).

    The aim of this change is to be able to have USE=valgrind in make.conf
    if you're an active user of it and have things work better, so it
    should be fine to do.

    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZGEoSF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZCD/QEAtOjUByuo7OINqpjzHtEbUvH4J3GEvxMyX5Br 9KjYP0gBAL9hPMyLw9LUNB29wKVnJ6Q3Gu+kIVH5Sp4ACPle4FIA
    =Cgab
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Sam James on Sun May 14 20:50:01 2023
    Sam James <sam@gentoo.org> writes:

    Alexe Stefan <stefanalexe48@gmail.com> writes:

    Does enabling USE=valgrind impact runtime performance in any way?

    A very small amount because it adds a check at runtime for whether
    the application is running under Valgrind. The compiler may be able
    to optimise this a bit if it can determine it's unlikely (if the
    Valgrind headers don't already do this, they should probably mark
    them as cold functions).

    Sorry, I should say, they're hot functions but the if()s for them
    should be unlikely()'d.



    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZGErMF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZB52AD+MhMkZ76dsm2mJUOANhPIFcwAM6nCqEAwA/g/ tXvV9BoA/1ts+p0PiqDJsnIEju5zvfVRRtwZa/0J0H/YSV8VR/QE
    =xDuP
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexe Stefan@21:1/5 to All on Sun May 14 20:20:01 2023
    Does enabling USE=valgrind impact runtime performance in any way?

    dum., 14 mai 2023, 19:46 Arsen Arsenović <arsen@gentoo.org> a scris:


    Sam James <sam@gentoo.org> writes:

    This always has the same meaning in packages - build in annotations to
    help
    with e.g. custom memory allocators to reduce noise and improve
    Valgrind's accuracy.

    All invalid uses of this were already fixed (cases where it was used to
    control
    running the testsuite under Valgrind which we don't want to do, it's too
    flaky
    under sandbox & not reliable with diff arches.)

    LGTM. thanks!

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    profiles/use.desc | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/profiles/use.desc b/profiles/use.desc
    index 04ca8e845ccd9..675fd291fee22 100644
    --- a/profiles/use.desc
    +++ b/profiles/use.desc
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # Keep them sorted
    @@ -333,6 +333,7 @@ usb - Add USB support to applications that have
    optional USB support (e.g. cups)
    v4l - Enable support for video4linux (using linux-headers or userspace
    libv4l libraries)
    vaapi - Enable Video Acceleration API for hardware decoding
    vala - Enable bindings for dev-lang/vala
    +valgrind - Enable annotations for accuracy. May slow down runtime slightly. Safe to use even if not currently using dev-util/valgrind
    vanilla - Do not add extra patches which change default behaviour; DO
    NOT USE
    THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
    vcd - Video CD support
    vdpau - Enable the Video Decode and Presentation API for Unix
    acceleration interface


    --
    Arsen Arsenović


    <div dir="auto">Does enabling USE=valgrind impact runtime performance in any way?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">dum., 14 mai 2023, 19:46 Arsen Arsenović &lt;<a href="mailto:arsen@gentoo.org">arsen@gentoo.org</a>&gt;
    a scris:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
    Sam James &lt;<a href="mailto:sam@gentoo.org" target="_blank" rel="noreferrer">sam@gentoo.org</a>&gt; writes:<br>

    &gt; This always has the same meaning in packages - build in annotations to help<br>
    &gt; with e.g. custom memory allocators to reduce noise and improve Valgrind&#39;s accuracy.<br>
    &gt;<br>
    &gt; All invalid uses of this were already fixed (cases where it was used to control<br>
    &gt; running the testsuite under Valgrind which we don&#39;t want to do, it&#39;s too flaky<br>
    &gt; under sandbox &amp; not reliable with diff arches.)<br>

    LGTM.  thanks!<br>

    &gt; Signed-off-by: Sam James &lt;<a href="mailto:sam@gentoo.org" target="_blank" rel="noreferrer">sam@gentoo.org</a>&gt;<br>
    &gt; ---<br>
    &gt;  profiles/use.desc | 3 ++-<br>
    &gt;  1 file changed, 2 insertions(+), 1 deletion(-)<br>
    &gt;<br>
    &gt; diff --git a/profiles/use.desc b/profiles/use.desc<br>
    &gt; index 04ca8e845ccd9..675fd291fee22 100644<br>
    &gt; --- a/profiles/use.desc<br>
    &gt; +++ b/profiles/use.desc<br>
    &gt; @@ -1,4 +1,4 @@<br>
    &gt; -# Copyright 1999-2022 Gentoo Authors<br>
    &gt; +# Copyright 1999-2023 Gentoo Authors<br>
    &gt;  # Distributed under the terms of the GNU General Public License v2<br> &gt;  <br>
    &gt;  # Keep them sorted<br>
    &gt; @@ -333,6 +333,7 @@ usb - Add USB support to applications that have optional USB support (e.g. cups)<br>
    &gt;  v4l - Enable support for video4linux (using linux-headers or userspace libv4l libraries)<br>
    &gt;  vaapi - Enable Video Acceleration API for hardware decoding<br>
    &gt;  vala - Enable bindings for dev-lang/vala<br>
    &gt; +valgrind - Enable annotations for accuracy. May slow down runtime<br> &gt; slightly. Safe to use even if not currently using dev-util/valgrind<br> &gt;  vanilla - Do not add extra patches which change default behaviour; DO NOT USE<br>
    &gt; THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically<br>
    &gt;  vcd - Video CD support<br>
    &gt;  vdpau - Enable the Video Decode and Presentation API for Unix acceleration interface<br>


    -- <br>
    Arsen Arsenović<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Sam James on Fri May 26 09:50:01 2023
    Sam James <sam@gentoo.org> writes:

    [[PGP Signed Part:Undecided]]

    Sam James <sam@gentoo.org> writes:

    Alexe Stefan <stefanalexe48@gmail.com> writes:

    Does enabling USE=valgrind impact runtime performance in any way?

    A very small amount because it adds a check at runtime for whether
    the application is running under Valgrind. The compiler may be able
    to optimise this a bit if it can determine it's unlikely (if the
    Valgrind headers don't already do this, they should probably mark
    them as cold functions).

    Sorry, I should say, they're hot functions but the if()s for them
    should be unlikely()'d.

    Alexander Monakov reached out and pointed out this isn't right - they're actually branchless and just encoded in nops, so there's really
    essentially no runtime cost.



    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZHBjNF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZCW9wD+Mm5kWvUeRL7+SstlNmztfbrlw9SMu1ixqvLR 9XpCZ5EA/2Obg2RFEdCe5UxatKX98Et1Xzmapq4NIhpFDf346okO
    =7wyS
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexe Stefan@21:1/5 to All on Sat May 27 16:00:01 2023
    In that case, is it worth it to enable USE=valgrind globally?

    vin., 26 mai 2023, 10:44 Sam James <sam@gentoo.org> a scris:


    Sam James <sam@gentoo.org> writes:

    [[PGP Signed Part:Undecided]]

    Sam James <sam@gentoo.org> writes:

    Alexe Stefan <stefanalexe48@gmail.com> writes:

    Does enabling USE=valgrind impact runtime performance in any way?

    A very small amount because it adds a check at runtime for whether
    the application is running under Valgrind. The compiler may be able
    to optimise this a bit if it can determine it's unlikely (if the
    Valgrind headers don't already do this, they should probably mark
    them as cold functions).

    Sorry, I should say, they're hot functions but the if()s for them
    should be unlikely()'d.

    Alexander Monakov reached out and pointed out this isn't right - they're actually branchless and just encoded in nops, so there's really
    essentially no runtime cost.




    <div dir="auto">In that case, is it worth it to enable USE=valgrind globally?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">vin., 26 mai 2023, 10:44 Sam James &lt;<a href="mailto:sam@gentoo.org">sam@gentoo.org</a>&gt; a scris:<br></
    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
    Sam James &lt;<a href="mailto:sam@gentoo.org" target="_blank" rel="noreferrer">sam@gentoo.org</a>&gt; writes:<br>

    &gt; [[PGP Signed Part:Undecided]]<br>
    &gt;<br>
    &gt; Sam James &lt;<a href="mailto:sam@gentoo.org" target="_blank" rel="noreferrer">sam@gentoo.org</a>&gt; writes:<br>
    &gt;<br>
    &gt;&gt; Alexe Stefan &lt;<a href="mailto:stefanalexe48@gmail.com" target="_blank" rel="noreferrer">stefanalexe48@gmail.com</a>&gt; writes:<br>
    &gt;&gt;<br>
    &gt;&gt;&gt; Does enabling USE=valgrind impact runtime performance in any way?<br>
    &gt;&gt;<br>
    &gt;&gt; A very small amount because it adds a check at runtime for whether<br> &gt;&gt; the application is running under Valgrind. The compiler may be able<br>
    &gt;&gt; to optimise this a bit if it can determine it&#39;s unlikely (if the<br>
    &gt;&gt; Valgrind headers don&#39;t already do this, they should probably mark<br>
    &gt;&gt; them as cold functions).<br>
    &gt;<br>
    &gt; Sorry, I should say, they&#39;re hot functions but the if()s for them<br> &gt; should be unlikely()&#39;d.<br>

    Alexander Monakov reached out and pointed out this isn&#39;t right - they&#39;re<br>
    actually branchless and just encoded in nops, so there&#39;s really<br> essentially no runtime cost.<br>


    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Alexe Stefan on Sat May 27 16:20:01 2023
    Alexe Stefan <stefanalexe48@gmail.com> writes:

    In that case, is it worth it to enable USE=valgrind globally?

    I have, and I'd say others interested in using Valgrind should too.



    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZHIP7F8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZCV+gEA4ITO4Y/Kpv9GYC+5YsOjlXFMWPlbPES/IO4P 9IpOoh8BAOJbOOVh5uJPLjdUyITa1iIzwQXCM2Ik3t2BOgFGnUAC
    =yOXz
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexe Stefan@21:1/5 to All on Sat May 27 19:30:01 2023
    So it's only useful for developers that already use valgrind.

    sâm., 27 mai 2023, 17:13 Sam James <sam@gentoo.org> a scris:


    Alexe Stefan <stefanalexe48@gmail.com> writes:

    In that case, is it worth it to enable USE=valgrind globally?

    I have, and I'd say others interested in using Valgrind should too.




    <div dir="auto">So it&#39;s only useful for developers that already use valgrind.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">sâm., 27 mai 2023, 17:13 Sam James &lt;<a href="mailto:sam@gentoo.org">sam@gentoo.org</a>&gt; a scris:<
    </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
    Alexe Stefan &lt;<a href="mailto:stefanalexe48@gmail.com" target="_blank" rel="noreferrer">stefanalexe48@gmail.com</a>&gt; writes:<br>

    &gt; In that case, is it worth it to enable USE=valgrind globally?<br>

    I have, and I&#39;d say others interested in using Valgrind should too.<br>


    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Alexe Stefan on Sat May 27 19:40:01 2023
    Alexe Stefan <stefanalexe48@gmail.com> writes:

    So it's only useful for developers that already use valgrind.

    Why would it be useful to anybody else? It can be useful if you suspect
    you may want to use Valgrind with system packages at some point and you
    don't want then to recompile, sure.

    I'm not sure if I understand your point. What perspective are you asking
    from?

    I wouldn't expect users who don't know what Valgrind is to set this.

    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZHI/V18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZAt3AD/b+PYuhl09WTkhdCu7ieQ6kglvActmnmhfgeK A3Kcp/oA/2Dfh6Wvkk1dyMXqzDyhYVe30it5i2MiDnAHCZlknQgI
    =sGEw
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)