lkml.org 
[lkml]   [2014]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] scripts/ksize: Add kernel build size report
On Sat, Nov 08, 2014 at 03:18:18PM -0800, Darren Hart wrote:
> ksize generates hierarchical build size reports from vmlinux, *.o, and
> built-in.o files.
>
> ksize is useful in preparing minimal configurations and comparing
> similar configurations across kernel versions.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> Cc: Josh Triplett <josh@joshtriplett.org>

One comment below; with that addressed:
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> +def main(argv):
> + try:
> + opts, args = getopt.getopt(argv[1:], "dh", ["help"])
> + except getopt.GetoptError, err:
> + print '%s' % str(err)
> + usage()
> + return 2
> +
> + driver_detail = False
> + for o, a in opts:
> + if o == '-d':
> + driver_detail = True
> + elif o in ('-h', '--help'):
> + usage()
> + return 0
> + else:
> + assert False, "unhandled option"
> +
> + cols = term_width()
> +
> + # Determine kernel version
> + p = Popen("strings vmlinux | grep 'Linux version' | cut -d ' ' -f 3",
> + shell=True, stdout=PIPE, stderr=PIPE)
> + version = p.communicate()[0].strip()

This seems like a very fragile, Perl-y way to obtain the kernel version.

I'd suggest either not including the version (just as bloat-o-meter
doesn't), or parsing it out using objdump -h -t and file offsetting
(looking for the offset and size of linux_banner). Personally I'd go
with the former.

- Josh Triplett


\
 
 \ /
  Last update: 2014-11-09 05:01    [W:0.126 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site