[Buildroot] [PATCH] support/scripts/check-host-libs: add new check on host binaries/libs

yann.morin at orange.com yann.morin at orange.com
Wed Sep 21 09:09:00 UTC 2022


Thomas, All,

On 2022-09-21 11:05 +0200, Thomas Petazzoni spake thusly:
> On Wed, 21 Sep 2022 08:23:54 +0000
> David Laight <David.Laight at ACULAB.COM> wrote:
> > Think a bit further and you can remove the exec of cmp, eg:
> > $ time find /usr/lib -type f | (ELF="$(printf '\x7f\x45\x4c\x46')"; while read f; do read l <"$f" && [ "${l#$ELF}" != "$l" ] && echo $f; done )| wc -l
> Thanks for the input and proposal. Isn't read l <"$f" going to read
> each file entirely in memory?

It should read a single "line", i.e. until the first \n, which can still
be quite a lot for binary files, yes. Hence my followup tweak that reads
only 4 bytes.

> > That takes a few seconds on my system.
> On my system, your command took 19 seconds. When doing this kind of
> test, make sure to drop the contents of the page cache first by doing:
> 
> echo 3 > /proc/sys/vm/drop_caches
> 
> Before each experiment. On my machine, with the page cache contents
> dropped, it takes 19-20 seconds to run your command the first time.
> Subsequent runs only last 12 seconds.

But usually, that will run just after the rsyncs to aggregate the host
dir, so everything will be cache-hot, which is what we care about...

Regards,
Yann E. MORIN.

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.




More information about the buildroot mailing list