Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document ZFS_DKMS_ENABLE_DEBUGINFO in userland configuration #9191

Merged
merged 1 commit into from
Aug 22, 2019
Merged

Document ZFS_DKMS_ENABLE_DEBUGINFO in userland configuration #9191

merged 1 commit into from
Aug 22, 2019

Conversation

mfoliveira
Copy link
Contributor

Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
configuration file, as done with the other ZFS_DKMS_* options.

It has been introduced with commit e45c173 ("dkms: Enable
debuginfo option to be set with zfs sysconfig file") but isn't
mentioned anywhere other than the dkms.conf file (generated).

Motivation and Context

The option to enable debuginfo in kernel modules built with DKMS
is not directly exposed to the user in the userland configuration file,
differently from other, existing options for similar purposes.

Even though a slightly more advanced user (who cares about debug
symbols, or has been asked to enable/build them) eventually can
figure out the dkms.conf file, this is certainly not too straighforward.

Since other, similar options are already in there, just add this one too.

Description

This exposes the ZFS_DKMS_ENABLE_DEBUGINFO option
(consumed by scripts/dkms.mkconf to generate a dkms.conf file)
in the userland configuration file, similarly to other related options.

How Has This Been Tested?

This has been tested by checking for .gnu_debuginfo section in kernel modules
built with DKMS before/after enabling this option (plus option to disable stripping),
and confirming the debug symbol information matched the source code lines.
(please see Testing section below.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Testing

Before:

$ find /lib/modules/5.2.0-10-generic/updates/dkms/ -name '*.ko' \
  | while read ko; do \
    echo "* $ko"; \
    objdump -h $ko \
      | grep .debug_info || echo '  - No .debug_info sections'; \
    echo; \
  done

* /lib/modules/5.2.0-10-generic/updates/dkms/zunicode.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/zlua.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/zavl.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/zfs.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/znvpair.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/zcommon.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/icp.ko
  - No .debug_info sections

* /lib/modules/5.2.0-10-generic/updates/dkms/spl.ko
  - No .debug_info sections

After:

$ grep ^PACKAGE_CONFIG /usr/src/zfs-0.8.1/dkms.conf
PACKAGE_CONFIG="/etc/default/zfs"

$ sudo sed -i \
  -e '/^ZFS_DKMS_ENABLE_DEBUGINFO=/ s/no/yes/' \
  -e '/^ZFS_DKMS_DISABLE_STRIP=/    s/no/yes/' \ 
  /etc/default/zfs

$ sudo dkms remove zfs/0.8.1 -k 5.2.0-10-generic
$ sudo dkms build  zfs/0.8.1 -k 5.2.0-10-generic
...
checking whether debuginfo support will be forced... yes
...
DKMS: build completed.

$ sudo dkms install zfs/0.8.1 -k 5.2.0-10-generic

$ find /lib/modules/5.2.0-10-generic/updates/dkms/ -name '*.ko' \
  | while read ko; do \
    echo "* $ko"; \
    objdump -h $ko \
      | grep .debug_info || echo '  - No .debug_info sections'; \
    echo; \
  done

* /lib/modules/5.2.0-10-generic/updates/dkms/zunicode.ko
 16 .debug_info   0003afc9  0000000000000000  0000000000000000  0004e227  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/zlua.ko
 19 .debug_info   0029ccfe  0000000000000000  0000000000000000  0001bd50  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/zavl.ko
 18 .debug_info   0001097b  0000000000000000  0000000000000000  0000110a  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/zfs.ko
 26 .debug_info   01137c6d  0000000000000000  0000000000000000  0018af72  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/znvpair.ko
 17 .debug_info   0004c59c  0000000000000000  0000000000000000  00009de1  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/zcommon.ko
 23 .debug_info   001202d1  0000000000000000  0000000000000000  0000a6f3  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/icp.ko
 22 .debug_info   004013ec  0000000000000000  0000000000000000  00033940  2**0

* /lib/modules/5.2.0-10-generic/updates/dkms/spl.ko
 26 .debug_info   001462e2  0000000000000000  0000000000000000  000107e1  2**0

$ objdump -d /lib/modules/5.2.0-10-generic/updates/dkms/zfs.ko | grep -A18 '<zfs_zinactive>:' | tail -n1
  100edc:	e8 4f c2 ff ff       	callq  fd130 <zfs_znode_hold_enter>

$ addr2line -pifae /lib/modules/5.2.0-10-generic/updates/dkms/zfs.ko 0x100edc
0x0000000000100edc: zfs_zinactive at /var/lib/dkms/zfs/0.8.1/build/module/zfs/zfs_znode.c:1320

$ sed -n 1320p /usr/src/zfs-0.8.1/module/zfs/zfs_znode.c
	zh = zfs_znode_hold_enter(zfsvfs, z_id);

Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
configuration file, as done with the other ZFS_DKMS_* options.

It has been introduced with commit e45c173 ("dkms: Enable
debuginfo option to be set with zfs sysconfig file") but isn't
mentioned anywhere other than the 'dkms.conf' file (generated).

Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 21, 2019
@behlendorf behlendorf merged commit 2f74950 into openzfs:master Aug 22, 2019
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 24, 2019
Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
configuration file, as done with the other ZFS_DKMS_* options.

It has been introduced with commit e45c173 ("dkms: Enable
debuginfo option to be set with zfs sysconfig file") but isn't
mentioned anywhere other than the 'dkms.conf' file (generated).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Closes openzfs#9191
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
configuration file, as done with the other ZFS_DKMS_* options.

It has been introduced with commit e45c173 ("dkms: Enable
debuginfo option to be set with zfs sysconfig file") but isn't
mentioned anywhere other than the 'dkms.conf' file (generated).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Closes openzfs#9191
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
configuration file, as done with the other ZFS_DKMS_* options.

It has been introduced with commit e45c173 ("dkms: Enable
debuginfo option to be set with zfs sysconfig file") but isn't
mentioned anywhere other than the 'dkms.conf' file (generated).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Closes #9191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants