Commit Graph

6 Commits (d5c0eaef1f7c3b705cc1cf3087bd83ad9098aa2f)

Author SHA1 Message Date
Arnout Vandecappelle (Essensium/Mind) f1768855e7 utils/size-stats-compare: fix flake8 error
utils/size-stats-compare:80:15: E225 missing whitespace around operator

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-02-01 21:52:35 +01:00
Thomas De Schampheleire 391f70b689 utils/size-stats-compare: add package name in detail output
size-stats-compare gives an overview of the size increase/decrease between
two cases, based on packages-file-list.txt. The 'detail' mode gives info per
file, otherwise per package.

But sometimes, you want the detailed per-file info, but only for a specific
package. Since the detailed output no longer lists the package name, you
cannot simply grep for it. A workaround was to filter the input
packages-file-list.txt's first, and then pass these filtered versions to
size-stats-compare.

Make this easier by adding the package name next to the filename in detailed
output. This allows grep'ing normally.
For example:

  $ utils/size-stats-compare orig new  -t 100 -d | grep ebtables

      -67712 removed ebtables             lib/ebtables/libebtc.so
      -66764 removed ebtables             lib/ebtables/libebt_nat.so
      -66752 removed ebtables             sbin/ebtables
      -66704 removed ebtables             lib/ebtables/libebt_arp.so
      -66700 removed ebtables             lib/ebtables/libebt_stp.so
      -66700 removed ebtables             lib/ebtables/libebt_among.so
      -66684 removed ebtables             lib/ebtables/libebt_ip.so
      -66676 removed ebtables             lib/ebtables/libebt_limit.so
      -66656 removed ebtables             lib/ebtables/libebt_log.so
      -66648 removed ebtables             lib/ebtables/libebt_mark.so
      -66636 removed ebtables             lib/ebtables/libebt_pkttype.so
      -66604 removed ebtables             lib/ebtables/libebt_vlan.so
      -66588 removed ebtables             lib/ebtables/libebt_ulog.so
      -66588 removed ebtables             lib/ebtables/libebt_nflog.so
      -66584 removed ebtables             lib/ebtables/libebt_arpreply.so
      -66544 removed ebtables             lib/ebtables/libebt_ip6.so
      -66540 removed ebtables             lib/ebtables/libebt_802_3.so
      -66536 removed ebtables             lib/ebtables/libebt_standard.so
      -66524 removed ebtables             lib/ebtables/libebt_mark_m.so
      -66524 removed ebtables             lib/ebtables/libebt_redirect.so
      -66452 removed ebtables             lib/ebtables/libebtable_filter.so
      -66452 removed ebtables             lib/ebtables/libebtable_broute.so
      -66452 removed ebtables             lib/ebtables/libebtable_nat.so
          45         ebtables             etc/ethertypes
       66752 added   ebtables             usr/sbin/ebtablesd
       66752 added   ebtables             usr/sbin/ebtables-legacy
       66752 added   ebtables             usr/sbin/ebtablesu
      200840 added   ebtables             usr/lib/libebtc.so.0.0.0

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2022-01-31 21:32:22 +01:00
Thomas De Schampheleire e9b1dffa5d utils/size-stats-compare: clarify meaning of variables in print_result
print_result is juggling with entry[x][y] which is not very readable.
While a better solution would be to use a class and reference named
attributes, that would require some bigger changes in the script.

Instead, make a minimal improvement by assigning the entry[x][y] values to
intermediate variables. Store them in a dict for easy usage from a format
string.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-31 21:24:40 +01:00
Petr Vorel 35f15db30a support: utils: use python3 explicitly
Python 2 is EOL sice 2020 [1], it's still available on distros, but may not
be installed by default (as being replaced by python3).

Thus remove compatibility imports:
from __future__ import print_function
from __future__ import absolute_import

Tested with python3 -m py_compile.

[1] https://www.python.org/doc/sunset-python-2/

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-09-22 21:30:24 +02:00
Ricardo Martincoski 19aaf8c3f1 size-stats-compare: fix code style
Fix these warnings:
E129 visually indented line with same indent as next logical line
E302 expected 2 blank lines, found 1

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-03-13 22:27:19 +01:00
Thomas Petazzoni 7ca9fc3170 tools: rename to 'utils'
After some discussion, we found out that "tools" has the four first
letters identical to the "toolchain" subfolder, which makes it a bit
unpractical with tab-completion. So, this commit renames "tools" to
"utils", which is more tab-completion-friendly.

This has been discussed with Arnout and Yann.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-01 18:07:00 +02:00