[asterisk-dev] size of debug information in zaptel/dahdi

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Nov 2 05:45:22 CST 2008


Hi

Zaptel and DAHDI modules seems to come with lots of debug information:

dahdi/linux/trunk/drivers/dahdi$ find * -name \*.ko -printf '%8k %p\n'
     100 dahdi_dummy.ko
     124 dahdi_dynamic_eth.ko
     116 dahdi_dynamic.ko
     112 dahdi_dynamic_loc.ko
      80 dahdi_echocan_jpah.ko
      88 dahdi_echocan_kb1.ko
      96 dahdi_echocan_mg2.ko
      84 dahdi_echocan_sec2.ko
      84 dahdi_echocan_sec.ko
     344 dahdi.ko
     108 dahdi_transcode.ko
     192 pciradio.ko
     208 tor2.ko
     420 wcb4xxp/wcb4xxp.ko
     128 wcfxo.ko
     140 wct1xxp.ko
    1978 wct4xxp/wct4xxp.ko
     308 wctc4xxp/wctc4xxp.ko
     821 wctdm24xxp/wctdm24xxp.ko
     196 wctdm.ko
     200 wcte11xp.ko
     569 wcte12xp/wcte12xp.ko
     164 xpp/xpd_fxo.ko
     176 xpp/xpd_fxs.ko
     188 xpp/xpd_pri.ko
    1005 xpp/xpp.ko
     156 xpp/xpp_usb.ko

dahdi/linux/trunk/drivers/dahdi$ find * -name \*.ko | xargs strip -g

dahdi/linux/trunk/drivers/dahdi$ find * -name \*.ko -printf '%8k %p\n'
       8 dahdi_dummy.ko
      12 dahdi_dynamic_eth.ko
      16 dahdi_dynamic.ko
       8 dahdi_dynamic_loc.ko
       8 dahdi_echocan_jpah.ko
       8 dahdi_echocan_kb1.ko
       8 dahdi_echocan_mg2.ko
       8 dahdi_echocan_sec2.ko
       8 dahdi_echocan_sec.ko
      84 dahdi.ko
      12 dahdi_transcode.ko
      68 pciradio.ko
      92 tor2.ko
     116 wcb4xxp/wcb4xxp.ko
      16 wcfxo.ko
      20 wct1xxp.ko
     368 wct4xxp/wct4xxp.ko
      56 wctc4xxp/wctc4xxp.ko
     136 wctdm24xxp/wctdm24xxp.ko
      44 wctdm.ko
      36 wcte11xp.ko
      76 wcte12xp/wcte12xp.ko
      36 xpp/xpd_fxo.ko
      40 xpp/xpd_fxs.ko
      44 xpp/xpd_pri.ko
     180 xpp/xpp.ko
      24 xpp/xpp_usb.ko

The man page of 'strip' claims that strip -g removes only debug 
information. Without this option, a strip would have rendered the module
unusable.

For a long time I had a similar one-liner that stripped that way (with
-g) the zaptel modules upon packaging the Debian package. This reduces
the size of the (compressed) package from 2.5MB to 0.5MB and unlike what
everybody thinks disk space (and mirror space, and network bandwidth) is
not *that* cheap. 

I had a long standing TODO item to make it less of a hack. Today after
consulting others in Debian, I realised that the Zapetl/DAHDI packages
are just about the only packages with that ammount of debugging
information.

Example test: vboxdrv is an external module. ext3 is one that comes with
the system.

$ cp /lib/modules/2.6.24-1-amd64/misc/vboxdrv.ko /lib/modules/2.6.24-1-amd64/kernel/fs/ext3/ext3.ko /tmp/

$ strip -g /tmp/ext3.ko /tmp/vboxdrv.ko

$ ls -l /lib/modules/2.6.24-1-amd64/misc/vboxdrv.ko /lib/modules/2.6.24-1-amd64/kernel/fs/ext3/ext3.ko  /tmp/ext3.ko /tmp/vboxdrv.ko
-rw-r--r-- 1 root    root     199039 2008-05-10 12:32 /lib/modules/2.6.24-1-amd64/kernel/fs/ext3/ext3.ko
-rw-r--r-- 1 root    root    1640067 2008-05-07 14:49 /lib/modules/2.6.24-1-amd64/misc/vboxdrv.ko
-rw-r--r-- 1 tzafrir tzafrir  198376 2008-11-02 13:21 /tmp/ext3.ko
-rw-r--r-- 1 tzafrir tzafrir 1639480 2008-11-02 13:21 /tmp/vboxdrv.ko

They remain almost non-affected. 

Is this a sign that I'm doing something wrong? Should the debug info end
up elsewhere? We create too much of it?

BTW: the proper way to strip debug information at install time is:

  INSTALL_MOD_STRIP=1 make install

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list