[PAHOLE]: Change the output of --packable to show orig size, new size and the diff

[acme@filo pahole]$ pahole --packable -e examples/dccp.ko.x86_64 | sort -k5 -nr | head -5
net_device: 1664 -> 1448: 216
module: 16960 -> 16848: 112
hh_cache: 192 -> 80: 112
zone: 2752 -> 2672: 80
softnet_data: 1792 -> 1728: 64
[acme@filo pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-04-02 10:12:09 -03:00
parent 18d620ee3c
commit 1ec66565a1
1 changed files with 5 additions and 3 deletions

View File

@ -160,9 +160,11 @@ static void print_classes(void (*formatter)(const struct structure *s))
list_for_each_entry(pos, &structures__list, node)
if (show_packable && !global_verbose) {
const struct class *c = pos->class;
const size_t savings = (class__size(c) -
class__size(c->priv));
printf("%s: %zd\n", class__name(c), savings);
const size_t orig_size = class__size(c);
const size_t new_size = class__size(c->priv);
const size_t savings = orig_size - new_size;
printf("%s: %zd -> %zd: %zd\n", class__name(c),
orig_size, new_size, savings);
} else
formatter(pos);
}