Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: refactoring



Andrew de Quincey wrote:

Please see my mail from two days ago for a detailed analysis with
objdump on the example of the cx27000/alps_tdmb7 driver, only about
1kByte from 6kB are actually code. Pathological examples like the
stv0299 are harder to analyze, here a big part of the code are probing
and if(tuner_type=XXX) {} handlers.

What is the size value returned from lsmod in that case?
about 6.5k if I remember correctly.

stv0299 now has no probing and minimal if (option=XXX) handlers.

mmmh... what's then causing this size?

$ size stv0299.o
text data bss dec hex filename
13787 1020 8 14815 39df stv0299.o

$ objdump -t stv0299.o | grep text

00000000 l d .text 00000000
00000000 l F .text 000000a0 stv0299_writereg
000000a0 l F .text 000000a2 stv0299_readreg
00000150 l F .text 0000009b stv0299_readregs
000001f0 l F .text 000000b3 pll_write
000002b0 l F .text 0000009f sl1935_set_tv_freq
00000350 l F .text 00000175 tsa5059_set_tv_freq
000004d0 l F .text 000003dd tua6100_set_tv_freq
000008b0 l F .text 00000068 pll_set_tv_freq
00000920 l F .text 00000212 stv0299_init
00000b40 l F .text 0000017f stv0299_set_FEC
00000cc0 l F .text 00000057 stv0299_get_fec
00000d20 l F .text 00000096 stv0299_wait_diseqc_fifo
00000dc0 l F .text 0000009b stv0299_wait_diseqc_idle
00000e60 l F .text 00000109 stv0299_send_diseqc_msg
00000f70 l F .text 000000ff stv0299_send_diseqc_burst
00001070 l F .text 00000119 stv0299_set_tone
00001190 l F .text 00000127 stv0299_set_voltage
000012c0 l F .text 000000b9 stv0299_send_legacy_dish_cmd
00001380 l F .text 000004e3 stv0299_set_symbolrate
00001870 l F .text 0000012c stv0299_get_symbolrate
000019a0 l F .text 000008da uni0299_ioctl
00002280 l F .text 000002ba probe_tuner
00002540 l F .text 000001c1 attach_adapter
00002710 l F .text 0000004c detach_client
00002760 l F .text 0000006f command
00000000 l d .init.text 00000000
00000000 l F .init.text 00000016 init_uni0299
00000000 l d .exit.text 00000000
00000000 l F .exit.text 0000002e exit_uni0299
00000000 g F .init.text 00000016 init_module
00000000 g F .exit.text 0000002e cleanup_module

0x19a0 - 0x0920 = 0x1080 (4224 decimal) bytes demod code exluding ioctl wrapper, including the DiSEqC control code that is not needed for all cards. That's about 1/3...1/4 of the entire current code size. So this driver would usually allocate 1-2 additional memory pages if linked completely to the card driver and the ioctl wrapper is only implemented once for all drivers (the demod code could communicate with the frontend infrastructure via a thin function-pointer-in-struct interface).

Holger





Home | Main Index | Thread Index