lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240801183637.GB122261@thelio-3990X>
Date: Thu, 1 Aug 2024 11:36:37 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Jose Fernandez <jose.fernandez@...ux.dev>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
	Christian Heusel <christian@...sel.eu>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Nicolas Schier <nicolas@...sle.eu>,
	Peter Jung <ptr1337@...hyos.org>, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kbuild: add debug package to pacman PKGBUILD

Hi Jose,

On Thu, Aug 01, 2024 at 07:29:40AM -0600, Jose Fernandez wrote:
> Add a new -debug package to the pacman PKGBUILD that will contain the
> vmlinux image for debugging purposes. This package depends on the
> -headers package and will be installed in /usr/src/debug/${pkgbase}.
> 
> The vmlinux image is needed to debug core dumps with tools like crash.
> 
> Signed-off-by: Jose Fernandez <jose.fernandez@...ux.dev>
> Reviewed-by: Peter Jung <ptr1337@...hyos.org>

This appears to add a non-trivial amount of time to the build when benchmarking
with Arch Linux's configuration (I measure 9% with hyperfine):

Benchmark 1: pacman-pkg @ 21b136cc63d2 ("minmax: fix up min3() and max3() too")
  Time (mean ± σ):     579.541 s ±  0.585 s    [User: 22156.731 s, System: 3681.698 s]
  Range (min … max):   578.894 s … 580.033 s    3 runs

Benchmark 2: pacman-pkg @ c5af4db0563b ("kbuild: add debug package to pacman PKGBUILD")
  Time (mean ± σ):     633.419 s ±  0.972 s    [User: 22247.886 s, System: 3673.879 s]
  Range (min … max):   632.302 s … 634.070 s    3 runs

Summary
  pacman-pkg @ 21b136cc63d2 ("minmax: fix up min3() and max3() too") ran
    1.09 ± 0.00 times faster than pacman-pkg @ c5af4db0563b ("kbuild: add debug package to pacman PKGBUILD")

It would be nice to add some option to avoid building this package for
developers who may not want it (I know I personally would not want it
with that penalty because I do a lot of bisects) or maybe adding a
target to build this package with the rest like 'pacman-pkg-with-dbg' or
something? Also, couldn't vmlinux be obtained from vmlinuz that already
exists in the main package via scripts/extract-vmlinux?

Cheers,
Nathan

> ---
>  scripts/package/PKGBUILD | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index 663ce300dd06..beda3db21863 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -6,6 +6,7 @@ pkgbase=${PACMAN_PKGBASE:-linux-upstream}
>  pkgname=("${pkgbase}" "${pkgbase}-api-headers")
>  if grep -q CONFIG_MODULES=y include/config/auto.conf; then
>  	pkgname+=("${pkgbase}-headers")
> +	pkgname+=("${pkgbase}-debug")
>  fi
>  pkgver="${KERNELRELEASE//-/_}"
>  # The PKGBUILD is evaluated multiple times.
> @@ -89,6 +90,15 @@ _package-headers() {
>  	ln -sr "${builddir}" "${pkgdir}/usr/src/${pkgbase}"
>  }
>  
> +_package-debug(){
> +    pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
> +    depends=(${pkgbase}-headers)
> +
> +    cd "${objtree}"
> +    mkdir -p "$pkgdir/usr/src/debug/${pkgbase}"
> +    install -Dt "$pkgdir/usr/src/debug/${pkgbase}" -m644 vmlinux
> +}
> +
>  _package-api-headers() {
>  	pkgdesc="Kernel headers sanitized for use in userspace"
>  	provides=(linux-api-headers)
> -- 
> 2.46.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ