Discussion:
Suggestions?
b***@touchstone-imagery.com
2005-10-27 18:23:10 UTC
Permalink
I am not sure if what I am asking is practical or not. I am writing a
STREAMS stack for a protocol over a serial connection. Tha catch is
that it is an embedded application and I need the object (streams.o) to
be as small as I can get it. The whole file system is on flash.

How can I best reduce the size of the file. I am not using clone or
multi or loopback (maybe on loopback). I am doing straight put() &
putq() up and down.

What modules is it posssible to leave out?

Thanks,
Bill!
Brian F. G. Bidulock
2005-10-27 23:14:13 UTC
Permalink
Bill,

If you look at the sizes of LiS modules:


text data bss dec hex filename
1512 424 0 1936 790 LiS/streams_bufmod.ko
2668 436 4 3108 c24 LiS/streams_echo.ko
198403 4640 609680 812723 c66b3 LiS/streams.ko
341 320 0 661 295 LiS/streams_liskmod.ko
3014 416 40 3470 d8e LiS/streams_mtdrv.ko
4666 516 8 5190 1446 LiS/streams_mux.ko
1734 424 0 2158 86e LiS/streams_nullmod.ko
1899 436 4 2339 923 LiS/streams_nuls.ko
1308 416 0 1724 6bc LiS/streams_pipemod.ko
657 608 0 1265 4f1 LiS/streams_relay3.ko
2814 424 0 3238 ca6 LiS/streams_testmod.ko
219016 9060 609736 837812 cc8b4 (TOTALS)

You will see that the static character device tables allocated by
LiS swallow up a whopping 609680 bytes. It wouldn't be so bad but
LiS uses less than a 10th of this space.

Even if you drop all the loadable modules (you probably don't need
them from your description), you still stuck with close to a meg of
streams.ko module.

Linux Fast-STREAMS is a little different:

text data bss dec hex filename
14658 1712 24 16394 400a streams/specfs.ko
1466 496 0 1962 7aa streams/streams_bufmod.ko
2308 940 0 3248 cb0 streams/streams_clone.ko
915 464 0 1379 563 streams/streams_connld.ko
2615 548 4 3167 c5f streams/streams_echo.ko
1300 684 0 1984 7c0 streams/streams_fifo.ko
44763 5948 1408 52119 cb97 streams/streams.ko
6698 548 32 7278 1c6e streams/streams_log.ko
3160 548 4 3712 e80 streams/streams_loop.ko
3900 644 8 4552 11c8 streams/streams_mux.ko
1414 812 0 2226 8b2 streams/streams_nsdev.ko
1278 496 0 1774 6ee streams/streams_nullmod.ko
2294 548 4 2846 b1e streams/streams_nuls.ko
1139 548 0 1687 697 streams/streams_pipe.ko
1072 464 0 1536 600 streams/streams_pipemod.ko
2749 708 40 3497 da9 streams/streams_sad.ko
2342 496 0 2838 b16 streams/streams_sc.ko
1136 548 0 1684 694 streams/streams_sfx.ko
2224 548 4 2776 ad8 streams/streams_spx.ko
63079 624 4 63707 f8db streams/streams_sth.ko
2184 496 0 2680 a78 streams/streams_testmod.ko
162694 18820 1532 183046 2cb06 (TOTALS)

Here you only need specfs, streams and streams_sth (if you need a
Stream Head). That's 132220 bytes. And that is compiled -O3.

If you configure --with-k-optimize=size you get:


text data bss dec hex filename
10803 1712 24 12539 30fb specfs.ko
34095 5948 1408 41451 a1eb streams.ko
47026 624 4 47654 ba26 streams_sth.ko
91924 8284 1436 101644 18d0c (TOTALS)

For a whopping 30% reduction to just over 100k.

You can configure openss7 release of LiS with --with-k-optimize=size
but it can't get around the bss. These are the LiS results on
Mandriva LE2005 with openss7 LiS-2.18.1.tar.gz compiled with the
same -Os flag:

text data bss dec hex filename
153665 4640 609680 767985 bb7f1 streams.ko
153665 4640 609680 767985 bb7f1 (TOTALS)

So, even if you could get around the monster bss, Linux Fast-STREAMS
is 67% smaller, and, oh, it runs over 3 times faster. passes over
600 POSIX test cases where LiS fails on 200 of them, ...

Recommendation: use Linux Fast-STREAMS -- your size will drop
dramatically, speed will increase significantly, and compilance will
meet expectations.

--brian
Post by b***@touchstone-imagery.com
I am not sure if what I am asking is practical or not. I am writing a
STREAMS stack for a protocol over a serial connection. Tha catch is
that it is an embedded application and I need the object (streams.o) to
be as small as I can get it. The whole file system is on flash.
How can I best reduce the size of the file. I am not using clone or
multi or loopback (maybe on loopback). I am doing straight put() &
putq() up and down.
What modules is it posssible to leave out?
Thanks,
Bill!
_______________________________________________
Linux-streams mailing list
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Steve Schefter
2005-10-28 12:38:46 UTC
Permalink
Post by b***@touchstone-imagery.com
I am not sure if what I am asking is practical or not. I am writing a
STREAMS stack for a protocol over a serial connection. Tha catch is
that it is an embedded application and I need the object (streams.o) to
be as small as I can get it. The whole file system is on flash.
How can I best reduce the size of the file. I am not using clone or
multi or loopback (maybe on loopback). I am doing straight put() &
putq() up and down.
We use LiS in our embedded system (32M RAM, 8M flash) along with much
more extensive serial protocol stacks implemented in streams modules,
a web server for configuration/stats, switching applications,
applications for communicating with client machines, etc. No problems.
Post by b***@touchstone-imagery.com
What modules is it posssible to leave out?
The basic streams environment will be in a module called streams.o.
That's all you need to load (besides your own). The user interface
will end up in libLiS which you link with your apps.

Steve

------------------------------------------------------------------------
Steve Schefter phone: +1 705 725 9999 x26
The Software Group Limited fax: +1 705 725 9666
642 Welham Road, email: ***@wanware.com
Barrie, Ontario CANADA L4N 9A1 Web: www.wanware.com
Loading...