Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-08 Thread Wolfgang Denk
Dear Lei Wen,

In message  
you wrote:
>
> >> And the 1.2.6 has some fix for the deflate, so it
> >> is maybe a good
> >> base line for introducing it.
> >
> > Which exact fix are you referring to?
> 
> I am referring to the zlib 1.2.5->1.2.6 changelog:
> Added deflatePending() to return the amount of pending output
> Allow deflateSetDictionary() and inflateSetDictionary() at any time in
> raw mode
> deflatePrime() can now insert bits in the middle of the stream

Are any of these relevant to U-Boot code?  To me it looks more like
extensions (which we do not use and thus not need) than bug fixes.
But I may be wrong.  Do you think it's fixes?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Committee, n.:  A group of men who individually can do nothing but as
a group decide that nothing can be done. - Fred Allen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-08 Thread Lei Wen
Hi Wolfgang,

On Thu, Mar 8, 2012 at 4:13 PM, Wolfgang Denk  wrote:
> Dear Lei Wen,
>
> In message 
>  you 
> wrote:
>>
>> > I wonder which benefits we get for this price we are paying?
>>
>> The main reason I'd like to introduce this upgrade is for I want to
>> add the compressing
>> feature for uboot.
>
> This should be make optional code, including any extensions /
> additional functions that may be needed for zlib.
>
> Most users will not need this, and they should not suffer (in terms of
> increased memory footprint) from such a change.
>
>> And the 1.2.6 has some fix for the deflate, so it
>> is maybe a good
>> base line for introducing it.
>
> Which exact fix are you referring to?

I am referring to the zlib 1.2.5->1.2.6 changelog:
Added deflatePending() to return the amount of pending output
Allow deflateSetDictionary() and inflateSetDictionary() at any time in
raw mode
deflatePrime() can now insert bits in the middle of the stream


>
>> How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile
>> the compression related code only when this flag is on?
>
> This makes sense, but please use standard naming rules.  You will
> probably provide a "zip" command, so make all this depend on
> "CONFIG_CMD_ZIP" or so.

Yep, that is also what I am thinking.

>
> Best regards,
>
> Wolfgang Denk

Thanks,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-08 Thread Wolfgang Denk
Dear Lei Wen,

In message  
you wrote:
> 
> > I wonder which benefits we get for this price we are paying?
> 
> The main reason I'd like to introduce this upgrade is for I want to
> add the compressing
> feature for uboot.

This should be make optional code, including any extensions /
additional functions that may be needed for zlib.

Most users will not need this, and they should not suffer (in terms of
increased memory footprint) from such a change.

> And the 1.2.6 has some fix for the deflate, so it
> is maybe a good
> base line for introducing it.

Which exact fix are you referring to?

> How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile
> the compression related code only when this flag is on?

This makes sense, but please use standard naming rules.  You will
probably provide a "zip" command, so make all this depend on
"CONFIG_CMD_ZIP" or so.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It must be remembered that there is nothing more difficult  to  plan,
more  doubtful  of  success,  nor  more dangerous to manage, than the
creation of a new system. For the initiator has the enmity of all who
would profit by the preservation of the old institutions  and  merely
lukewarm defenders in those who would gain by the new ones.
- Machiavelli
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-07 Thread Lei Wen
Hi Wolfgang,

On Wed, Mar 7, 2012 at 10:30 PM, Wolfgang Denk  wrote:
> Dear Lei Wen,
>
> In message 
>  you 
> wrote:
>>
>> I miss add the zconf.h into the patch...
>> V2 patch is attached...
>
> Argh.  Please NEVER send patches as attachments.  Always send them
> inline.  See http://www.denx.de/wiki/U-Boot/Patches

Sorry for that again. I send the patch as attachment, which is only
for RFC, and another
reason is the patch itself is very huge and almost all content is kept
as it is from zlib
main stream. Anyway, I would keep the send patch rule in mind next time.

>
>> As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6
>> contains following:
>>
>> gzread() can now read a file that is being written concurrently
>> gzgetc() is now a macro for increased speed
>> Added a 'T' option to gzopen() for transparent writing (no compression)
>> Added deflatePending() to return the amount of pending output
>> Allow deflateSetDictionary() and inflateSetDictionary() at any time in
>> raw mode
>> deflatePrime() can now insert bits in the middle of the stream
>> ./configure now creates a configure.log file with all of the results
>> Added a ./configure --solo option to compile zlib with no dependency on
>> any libraries
>> Fixed a problem with large file support macros
>> Fixed a bug in contrib/puff
>> Many portability improvements
>
> This is a lot of changes / improvements for genral use, but which of
> these are actually useful for U-Boot?
>
> I. e. what exactly is the motivation to switch to a new version of the
> code?  Do you want to fix any specific bugs, or improve performance,
> or what?
>
> What I see is that the code size grows by about 2 kB (measured on
> ARM):
>
> -> bloat-o-meter u-boot-before u-boot-after
> add/remove: 23/2 grow/shrink: 2/5 up/down: 4523/-2496 (2027)
> function                                     old     new   delta
> static.lenfix                                  -    2048   +2048
> inflateCopy                                    -     352    +352
> updatewindow                                   -     308    +308
> inflateSync                                    -     276    +276
> inflateSetDictionary                           -     192    +192
> static.adler32_combine_                        -     156    +156
> inflateReset2                                  -     152    +152
> inflateResetKeep                               -     148    +148
> static.distfix                                 -     128    +128
> inflatePrime                                   -     116    +116
> inflateMark                                    -     104    +104
> syncsearch                                     -      84     +84
> zmemcmp                                        -      68     +68
> inflateSyncPoint                               -      64     +64
> inflateGetHeader                               -      64     +64
> inflate_copyright                              -      47     +47
> inflateUndermine                               -      44     +44
> inflate                                     5764    5800     +36
> zmemzero                                       -      28     +28
> zmemcpy                                        -      28     +28
> zError                                         -      24     +24
> adler32_combine64                              -      20     +20
> adler32_combine                                -      20     +20
> zlibVersion                                    -      12     +12
> zunzip                                       264     268      +4
> inflateEnd                                   108     100      -8
> inflateInit2_                                264     208     -56
> inflate_table                               1492    1428     -64
> inflateReset                                 128      48     -80
> inflate_fast                                1480    1368    -112
> distfix                                      128       -    -128
> lenfix                                      2048       -   -2048
>
>
> I wonder which benefits we get for this price we are paying?

The main reason I'd like to introduce this upgrade is for I want to
add the compressing
feature for uboot. And the 1.2.6 has some fix for the deflate, so it
is maybe a good
base line for introducing it.

Also the reason why I want to enable the compressing is that sometimes we may
want to dump whole ram in the uboot, and since the ram grows bigger and bigger,
compressing and then send to host is a reasonable method to reduce the
dumping time.

How about define a Macro like CONIFG_ENABLE_GZIP_COMPRESSION to compile
the compression related code only when this flag is on?

>
> Best regards,
>
> Wolfgang Denk

Thanks,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-07 Thread Wolfgang Denk
Dear Lei Wen,

In message  
you wrote:
>
> I miss add the zconf.h into the patch...
> V2 patch is attached...

Argh.  Please NEVER send patches as attachments.  Always send them
inline.  See http://www.denx.de/wiki/U-Boot/Patches

> As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6
> contains following:
> 
> gzread() can now read a file that is being written concurrently
> gzgetc() is now a macro for increased speed
> Added a 'T' option to gzopen() for transparent writing (no compression)
> Added deflatePending() to return the amount of pending output
> Allow deflateSetDictionary() and inflateSetDictionary() at any time in
> raw mode
> deflatePrime() can now insert bits in the middle of the stream
> ./configure now creates a configure.log file with all of the results
> Added a ./configure --solo option to compile zlib with no dependency on
> any libraries
> Fixed a problem with large file support macros
> Fixed a bug in contrib/puff
> Many portability improvements

This is a lot of changes / improvements for genral use, but which of
these are actually useful for U-Boot?

I. e. what exactly is the motivation to switch to a new version of the
code?  Do you want to fix any specific bugs, or improve performance,
or what?

What I see is that the code size grows by about 2 kB (measured on
ARM):

-> bloat-o-meter u-boot-before u-boot-after
add/remove: 23/2 grow/shrink: 2/5 up/down: 4523/-2496 (2027)
function old new   delta
static.lenfix  -2048   +2048
inflateCopy- 352+352
updatewindow   - 308+308
inflateSync- 276+276
inflateSetDictionary   - 192+192
static.adler32_combine_- 156+156
inflateReset2  - 152+152
inflateResetKeep   - 148+148
static.distfix - 128+128
inflatePrime   - 116+116
inflateMark- 104+104
syncsearch -  84 +84
zmemcmp-  68 +68
inflateSyncPoint   -  64 +64
inflateGetHeader   -  64 +64
inflate_copyright  -  47 +47
inflateUndermine   -  44 +44
inflate 57645800 +36
zmemzero   -  28 +28
zmemcpy-  28 +28
zError -  24 +24
adler32_combine64  -  20 +20
adler32_combine-  20 +20
zlibVersion-  12 +12
zunzip   264 268  +4
inflateEnd   108 100  -8
inflateInit2_264 208 -56
inflate_table   14921428 -64
inflateReset 128  48 -80
inflate_fast14801368-112
distfix  128   --128
lenfix  2048   -   -2048


I wonder which benefits we get for this price we are paying?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Probably the best operating system in the world  is  the  [operating
system] made for the PDP-11 by Bell Laboratories."
   - Ted Nelson, October 1977
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-07 Thread Wolfgang Denk
Dear Lei Wen,

In message  
you wrote:
> --20cf300fafe1db2c6604ba8f33fe
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi,
> 
> In this patch, I update the current zlib from 1.2.5 to 1.2.6.
> 
> There is a lot of warnings when using checkpatch script, I don't know whether
> I should fix it or not...
> Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't do
> the correction, so don't be panic when use checkpatch.
> 
> Best regards,
> Lei

This text should not be here.  It would become part of the commit
message.  Please add such comments only to the comment section, i. e.
below the '---' line.

> 
> As it copy from zlib home page, the improvement from 1.2.5 to 1.2.6
> contains following:
> 
> gzread() can now read a file that is being written concurrently
> gzgetc() is now a macro for increased speed
> Added a 'T' option to gzopen() for transparent writing (no compression)
> Added deflatePending() to return the amount of pending output
> Allow deflateSetDictionary() and inflateSetDictionary() at any time in
> raw mode
> deflatePrime() can now insert bits in the middle of the stream
> ./configure now creates a configure.log file with all of the results
> Added a ./configure --solo option to compile zlib with no dependency on
> any libraries
> Fixed a problem with large file support macros
> Fixed a bug in contrib/puff
> Many portability improvements

Unfortunately the new code is not even compile clean:

-> ./MAKEALL m28evk
Configuring for m28evk board...
In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:5: error: unknown type name 
‘z_const’
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:86:19: error: expected ‘:’, ‘,’, 
‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
In file included from /home/wd/git/u-boot/tmp/lib/crc32.c:20:0:
/home/wd/git/u-boot/tmp/include/u-boot/zlib.h:1326:21: error: expected ‘=’, 
‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Z_ARG’
make[1]: *** [crc32.o] Error 1
make[1]: *** Waiting for unfinished jobs
make: *** [tools] Error 2


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Teenagers are people who express a burning desire to be different by
dressing exactly alike.
There are some strings. They're just not attached.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-06 Thread Lei Wen
Hi Mike,

On Wed, Mar 7, 2012 at 12:15 AM, Mike Frysinger  wrote:
> On Tuesday 06 March 2012 03:55:19 Lei Wen wrote:
>> In this patch, I update the current zlib from 1.2.5 to 1.2.6.
>>
>> There is a lot of warnings when using checkpatch script, I don't know
>> whether I should fix it or not...
>> Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't
>> do the correction, so don't be panic when use checkpatch.
>
> did you test the performance ?  i found it went down a bit which is why i
> didn't post a patch to update it to a newer version.  improvements in API's we
> don't use aren't a good reason for updating ...

I didn't do the performance test... Just did the compile and bring up
a gziped kernel
with the update zlib.

Is there some easy test case which could run in the uboot to show the
unzip speed?
I'd like to help to test it...

But your saying is right, we should always focus on our current usage.

> -mike

Thanks,
Lei
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] lib: zlib: update to 1.2.6

2012-03-06 Thread Mike Frysinger
On Tuesday 06 March 2012 03:55:19 Lei Wen wrote:
> In this patch, I update the current zlib from 1.2.5 to 1.2.6.
> 
> There is a lot of warnings when using checkpatch script, I don't know
> whether I should fix it or not...
> Since it is just copy from as it is from upstream zlib 1.2.6, so I didn't
> do the correction, so don't be panic when use checkpatch.

did you test the performance ?  i found it went down a bit which is why i 
didn't post a patch to update it to a newer version.  improvements in API's we 
don't use aren't a good reason for updating ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot