Features/MiniDebugInfo

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
m (Fixed layout)
(Update status)
 
(8 intermediate revisions by 4 users not shown)
Line 11: Line 11:
 
* Targeted release: Fedora 18
 
* Targeted release: Fedora 18
 
* Last updated: 2012-05-07
 
* Last updated: 2012-05-07
* Percentage of completion: 0%
+
* Percentage of completion: 100%
 +
 
 +
The changes needed to generate MiniDebugInfo has landed in rpm 4.10.0-3 and
 +
was enabled by default in redhat-rpm-config 9.1.0-32. gdb supports reading the minidebuginfo since version 7.4.50.20120703-12.fc18.
  
 
== Detailed Description ==
 
== Detailed Description ==
Line 100: Line 103:
 
|}
 
|}
  
Compared to the current size of a Fedora install and the large churn
+
To minimize space use (on the installed system but also on the  
of package update an on-disk increase of 43Mb is quite modest, so we
+
installer medium) we've decided to only go with the compressed symbols.
should be able to at least ship the compressed minimal symbol table
+
information by default.
+
  
There are several choices to be made here:
+
The implementation we use is that the normal separate debuginfo object
 
+
is stripped of the non-minimal debug info, compressed with xz and then
* Compressed or uncompressed
+
injected into the main binary. Then gdb can use this as a fallback
Storing the data compresses will use less diskspace, but may cause
+
if the normal debuginfo package is not installed.
an additional performance and memory hit when using the data.
+
+
This also affects how the "normal" debuginfo is handled. If
+
accessing the minidebuginfo isn't too slow, then that information
+
could be left out of the .debuginfo packages, making them smaller.
+
 
+
* Keep the data in the original or in a separate package.
+
If the data is kept in the originating binaries (I have patches that
+
allows this while using compression) then supporting minidebuginfo is
+
transparent to users, but non-optional.
+
+
If we create new minidebuginfo packages for the minidebuginfo then
+
the data can be made optional, but will require modifications
+
to the package handling in order to automatically install and update
+
the new packages. It also makes the change quite visible to users, as
+
the new packages will be visible in the UI in a lot of places.
+
 
+
* Do we add line number information
+
The line number information is an additional piece of information
+
that can be quite useful, but it is also quite a lot larger than
+
just the symbols.
+
 
+
These affect the implementation chosen and must be decided initially.
+
  
 
== Benefit to Fedora ==
 
== Benefit to Fedora ==
Line 149: Line 127:
  
 
Generation of the minidebuginfo just requires a few lines in
 
Generation of the minidebuginfo just requires a few lines in
/usr/lib/rpm/find-debuginfo.sh, and possibly some additional rpm
+
/usr/lib/rpm/find-debuginfo.sh.
macros to create new subpackages.
+
  
 
Consumers of debuginfo (mainly gdb, but also profilers, etc) must be
 
Consumers of debuginfo (mainly gdb, but also profilers, etc) must be
 
changed to look in additional places for extra debug info.
 
changed to look in additional places for extra debug info.
  
If we chose to use separate rpms for the minidebuginfo we also needs
+
This feature requires a mass rebuild to generate the new minidebuginfo
modifications to the build system, the package mirroring system,
+
for all packages.
the installer, the package installation tools, etc.
+
  
 
== How To Test ==
 
== How To Test ==
Line 164: Line 140:
 
backtrace with function names for all frames by doing:
 
backtrace with function names for all frames by doing:
  
1. Run "gdb <program name>"
+
# Run "gdb <program name>"
2. Type "run"
+
# Type "run"
3. Do something
+
# Do something
4. Press ctrl-c to get back to gdb
+
# Press ctrl-c to get back to gdb
5. Type "bt" and watch the full backtrace
+
# Type "bt" and watch the full backtrace. There should be real function names everywhere, no "??" entries
  
 
== User Experience ==
 
== User Experience ==
Line 175: Line 151:
 
information is mainly targeted towards developers.
 
information is mainly targeted towards developers.
  
== Dependencies ==
+
There will be a slight increase in the size of the binaries. Custom
 +
installations (like embedded images) can avoid this size increase by
 +
stripping the binaries like this:
 +
<pre>
 +
 strip -R .gnu_debugdata $binary_file
 +
</pre>
 +
 
 +
== Dependencies / affected packages ==
 
* gdb
 
* gdb
 
* rpm
 
* rpm
 
+
* redhat-rpm-config
If using separate minidebug packages
+
* libunwind
* yum
+
* elfutils
* anaconda
+
* ABRT
* pkg-kit
+
* Possibly other package handling apps
+
  
 
== Contingency Plan ==
 
== Contingency Plan ==
  
None necessary, revert to previous release behaviour.
+
Revert the change and rebuild all packages.
  
 
== Documentation ==
 
== Documentation ==
Line 193: Line 174:
  
 
== Release Notes ==
 
== Release Notes ==
* Fedora 18 ships with a small subset of debug information by default. Full debug information is still availible in the debuginfo packages.
+
* Fedora 18 ships with a small subset of debug information by default. Full debug information is still available in the debuginfo packages.
  
 
== Comments and Discussion ==
 
== Comments and Discussion ==
 
* See [[Talk:Features/MiniDebugInfo]]
 
* See [[Talk:Features/MiniDebugInfo]]
  
[[Category:FeaturePageIncomplete]]
+
[[Category:FeatureAcceptedF18]]
<!-- When your feature page is completed and ready for review -->
+
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
+
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
+
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->
+

Latest revision as of 20:00, 13 July 2012

Contents

[edit] MiniDebugInfo

[edit] Summary

Install minimal debuginfo by default to increase quality of bug reports and allow easier support for profiling and user space tracing.

[edit] Owner

[edit] Current status

  • Targeted release: Fedora 18
  • Last updated: 2012-05-07
  • Percentage of completion: 100%

The changes needed to generate MiniDebugInfo has landed in rpm 4.10.0-3 and was enabled by default in redhat-rpm-config 9.1.0-32. gdb supports reading the minidebuginfo since version 7.4.50.20120703-12.fc18.

[edit] Detailed Description

The debuginfo packages in Fedora are very useful if you're a developer and you are debugging a bug on your machine. However, they are very large, so they cannot be deployed in a wider scale. In many usecases you really only need enough information to be able to create backtraces, which is far smaller and could be installed by default.

The main advantage of this is a general improvement of bug report quality (as reported via ABRT or manually), as the reports will have complete backtraces from all users. Additionally things like system wide profiling and userspace tracing would also be possible without large debuginfo installation.

Debug info for backtraces relies on two types of information, the function names in the symbol tables, and (optionally) the linenumber debug information. I wrote a script that takes our current debuginfo packages and generates minimal debuginfo files containing only the minimal function name information and optionally line number information. Here are the sizes it generates for some F17 packages:

Package Size of executables symbols xz symbols symbols+lines xz symbols+lines
coreutils 4851 Kb 15.46% 3.92% 38.82% 14.15%
gcc 13003 Kb 3.54% .87% 23.68% 10.13%
gdb 5062 Kb 3.98% .85% 18.67% 8.25%
libreoffice-core 142897 Kb 17.96% 2.38% 61.22% 11.76%
libreoffice-writer 11501 Kb 18.52% 2.73% 71.27% 12.42%
cairo 808 Kb 11.95% 2.46% 33.56% 13.08%
gimp 14828 Kb 8.89% 1.89% 29.43% 7.90%
gtk2 6007 Kb 11.46% 2.22% 28.20% 8.72%
gtk3 5302 Kb 8.73% 1.64% 26.08% 8.37%
webkitgtk 31147 Kb 18.51% 2.68% 98.03% 13.75%
webkitgtk3 31143 Kb 18.50% 2.68% 97.97% 13.76%
nautilus 2039 Kb 14.59% 2.89% 33.09% 10.20%
evolution 7492 Kb 8.16% 1.82% 25.95% 7.96%
xulrunner 25533 Kb 43.78% 6.97% 108.84% 22.11%
qt3 10458 Kb .89% .21% 21.58% 7.18%
qt 12377 Kb 14.65% 2.17% 58.66% 12.34%
qtwebkit 25989 Kb 19.03% 2.83% 92.24% 13.29%
kdelibs 36231 Kb 10.20% 1.84% 36.91% 9.35%
kde-baseapps 8030 Kb 11.48% 2.46% 32.44% 9.22%
samba 17508 Kb 3.25% .63% 16.90% 5.31%
httpd 2496 Kb 11.83% 2.97% 25.53% 9.94%
llvm-libs 23176 Kb 2.78% .42% 33.83% 9.41%
emacs 12445 Kb 1.17% .30% 4.98% 2.29%
Total 450334 Kb 15.21% 2.32% 58.24% 11.42%

On my F17 installation /usr is 8771 Mb, and 1861 Mb of that is made up of ELF binaries. Leading to the following estimations for full-distro sizes:

symbols xz symbols symbols+lines xz symbols+lines
Estimated minidebuginfo size 283Mb 43Mb 1084Mb 213Mb
Estimated percentage of /usr 3.2% 0.5% 12.3% 2.4%

To minimize space use (on the installed system but also on the installer medium) we've decided to only go with the compressed symbols.

The implementation we use is that the normal separate debuginfo object is stripped of the non-minimal debug info, compressed with xz and then injected into the main binary. Then gdb can use this as a fallback if the normal debuginfo package is not installed.

[edit] Benefit to Fedora

We get better bug reports by default, even when offline or on a bad link, without users having to wait while downloading large amounts of data, or having to send possibly privacy sensitive core information to anyone. Additionally this will work for all packages built on the system (not only the official packages, but also site-specific packages) and will work with or without ABRT (some sites may not want to send bug reports to ABRT but collect them locally).

It will also make it easier to do things like system wide profiling, userspace dynamic probes and causual debugging.

[edit] Scope

Generation of the minidebuginfo just requires a few lines in /usr/lib/rpm/find-debuginfo.sh.

Consumers of debuginfo (mainly gdb, but also profilers, etc) must be changed to look in additional places for extra debug info.

This feature requires a mass rebuild to generate the new minidebuginfo for all packages.

[edit] How To Test

Running any application under gdb you should be able to get a backtrace with function names for all frames by doing:

  1. Run "gdb <program name>"
  2. Type "run"
  3. Do something
  4. Press ctrl-c to get back to gdb
  5. Type "bt" and watch the full backtrace. There should be real function names everywhere, no "??" entries

[edit] User Experience

The end-user experience should be minimally changed. The new debug information is mainly targeted towards developers.

There will be a slight increase in the size of the binaries. Custom installations (like embedded images) can avoid this size increase by stripping the binaries like this:

 strip -R .gnu_debugdata $binary_file

[edit] Dependencies / affected packages

  • gdb
  • rpm
  • redhat-rpm-config
  • libunwind
  • elfutils
  • ABRT

[edit] Contingency Plan

Revert the change and rebuild all packages.

[edit] Documentation

  • No relevant documentation

[edit] Release Notes

  • Fedora 18 ships with a small subset of debug information by default. Full debug information is still available in the debuginfo packages.

[edit] Comments and Discussion