[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-tiny
Subject:    Re: RFC - config size test output
From:       john cooper <john.cooper () third-harmonic ! com>
Date:       2007-10-30 20:28:30
Message-ID: 472793EE.4080101 () third-harmonic ! com
[Download RAW message or body]

Folks,
     Here is a snapshot of a work in progress to characterize
kernel footprint with respect to configuration options.  The
primary motivation was to avoid the "monkey at the keyboard"
approach of manually iterating through builds for all options
of interest both enabled and disabled.  This generates ".config"
files automatically for most binary options however requires
initial manual intervention for others.  Upon a successful
build for each config option a size report is generated.

This work currently is slightly specific to a TI OMAP2430
target and requires tools such as u-boot's mkimage to be
available.  However the lion's share of the structure is
generic.  You may find a bzip2 compressed tar archive of the
snapshot here:

       ftp://ftp.windriver.com/pub/john/kernel_footprint/Build.configs-071023.tb2

One notable TBD is addition of using qemu to boot each kernel
and harvest the freemem total immediately before exec of init.
This component is missing from the footprint accounting, however
a trivial kernel patch is included to generate the information.
The mechanics of including such in the size reports has yet to
be integrated.

Attached to this mail is an excerpt of the documentation contained
in the driver script which hopefully offers some insight into the
gear works.  Comments and suggestions are welcome.

-john

-- 
john.cooper@third-harmonic.com

["Build.configs-doc" (text/plain)]

#! /bin/bash

# Build.configs -- run kernel option builds, produce footprint report
#
# Copyright (c) 2007 Wind River Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

usage="usage: $0 -[clean d f n p r t v y] <CONFIG_OPTION>*"

# flags:
#
#	<none>:	automatically build where needed for implied/explicit
#           config options and produce a report summary per option
#
#	-r: omit build, generate report from prior build data
#
#	-d: summarize post config file differences
#
#	-f: force configuration generation and a build even if 
#		prior data exists
#
#	-p: copy associated post-config-? files to config-? files
#       and force a rebuild (implies -f)
#
#	-clean: remove all prior build config and accounting data and exit
#
#	-v: be verbose
#
#	-y:	(debug) build only for associated option enabled
#		In this case no report is generated
#
#	-n:	(debug) build only for associated option disabled
#		In this case no report is generated
#
#	-t: (debug) for test purposes
#

# john.cooper@windriver.com:
# 07/07/10	Created
# 07/07/16	Cleanup
# 07/07/18	Generalized reports, cli
# 07/07/19	relax whitespace in config/quirk files
# 07/07/27	various fixes, support build restart
# 07/09/17	make more robust & user friendly
# 07/10/04	fix verifybuild()+XIP breakage, add -d option
# 07/10/08  add -p option
# 07/10/15  minor cleanup, add copyright
#
# OVERVIEW
#
# This script is used to derive kernel image size footprint
# respective to configuration parameters of interest.  For
# the most part with a binary yes/no option, creation of the
# corresponding "config-y" and "config-n" files is automatic.
# For non-binary options or dependant options, stdin will be
# prompted to provide the required information, or the user
# can preset "config-y" and "config-n" beforehand.
#
# DIRECTORY STRUCTURE
#
# ./Build.configs -- this utility
# ./M -- kernel makefile wrapper
# ./configs/ -- containing directory for all config options of interest
# ./configs/config-base -- template kernel config file
# ./configs/defaults -- contains global parameter defaults
# ./configs/CONFIG_<xyz>/ -- containing directory for the "xyz" option
# ./configs/CONFIG_*/config-y -- kernel config file, option enabled
# ./configs/CONFIG_*/config-n -- kernel config file, option disabled
# ./configs/CONFIG_*/post-config-y -- kernel post config file, option enabled
# ./configs/CONFIG_*/post-config-n -- kernel post config file, option disabled
# ./configs/CONFIG_*/quirks-? -- parameters to address special build cases
# ./configs/CONFIG_*/*-size -- size reports for the associated config option
#
# CONFIGURATION FILES
#
# When a build is attempted, if the associated configs/CONFIG_*/config-?
# file is present it will be used verbatim as input to the build,
# otherwise an attempt will be made to generate the file.  If additional
# information is required, stdin will be prompted.  In either case
# upon a successful kernel build configs/CONFIG_*/post-config-?
# will contain the resulting config file which may differ from the
# input config file due to Kconfig rules.  [Note copying a post-config-?
# file from a prior build to the associated config-? file and re-running
# the build should produce an identical kernel and post-config-?.]
#
# For config options more complex than binary y/n cases, the post-config-?
# file serves as an exact definition of how the option was specified and
# qualifies the conditions of the associated image size differential.
#
# If the flag -p is present the associated post-config-? file must exist,
# is copied to config-? and a build of the option is performed.
# Note this is essentially a carbon copy rebuild of the prior build and
# can be used to force a rebuild without requiring an auto generation of 
# config-y input files and possible manual intervention.  Useful for
# automating builds on candidate kernels once a full set of post-config-?
# have been generated.
#
# SIZE REPORTS
#
# Size reports are created for vmlinux (vmlinux-size) and generally for
# the default compressed image format *Image (*Image-size) for both
# y/n configurations.  For vmlinux the object file footprint is
# described by size(1) including the y/n difference.  *Image files are
# reported 
#
# GLOBAL DEPENDENCIES
#
# Build.configs expects to execute the command $kmake to build a kernel
# which may simply be set to the kernel make command invocation or a
# wrapper script which configures toolchain paths, etc.. prior to invoking
# the kernel make.  It is the latter case in use within this work and
# the wrapper script "M" is used to launch a kernel build.  Similar to
# $kmake,  $btarg defines the kernel make target corresponding to the
# compressed image.
#
# Both $kmake and $btarg will default to $kmake_def and $btarg_def
# respectively which are themselves defined in configs/defaults.
# When needed $kmake and $btarg can be overridden in a config option's
# quirk file (below).
#
# PER CONFIG DEPENDENCIES
#
# The quirks-? file is optional and when present contains definitions of
# the form "VAR=parm" which result in shell variables during build time
# to exist in this utility of the form "var=parm".  This is used to
# override default behavior in Build.configs explicitly and currently is
# only used for CONFIG_XIP_KERNEL.
#
# EXAMPLES
#
# 	$ ./Build.configs    [builds kernels for all configs/CONFIG_*
#                           and generates size reports]
#
# 	$ ./Build.configs XYZ
# 	$ ./Build.configs CONFIG_XYZ   [builds kernel configs/CONFIG_XYZ]
#
#	$ ./Build.configs -r      [generates size reports for all configs/CONFIG_*]
#	$ ./Build.configs -r -d   [same as above plus post config diff summaries]
#


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic