Linux Tiny Test Project

From eLinux.org
Revision as of 05:44, 14 July 2007 by Chris (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

This is a project to implement an automated test framework for finding the specific sub-patches or configuration options (in the total set of Linux tiny sub-patches) which yeild the biggest size improvements.

The main motivation for this is the (overwhelming) number of sub-patches in the linux-tiny patchset. In order to avoid doing a manual test of each sub-patch, this framework was conceived as a method of isolate the most important sub-patches of the patchset, in order to focus our attention on those.

The basic idea is that an automated script will run which will test each configuration option provided by the Linux-tiny patchset. For each one, the script will measure the reduction in size of the Linux kernel that results from turning that option on. From this, a list of the 'top-10' configuration options will be made. Subsequently, patches to support those top-10 configuration options will be ported and analyzed on non-x86 processor platforms.

This will give us a starting point to determine the most beneficial parts of the linux-tiny patchset.

Alert.gif It is recognized that some parts of Linux-tiny are tools for size evaluation. Some parts affect dynamic memory size, rather than the static size from the kernel compilation. While the technique described here is crude and ignores these parts, it's at least a starting point for evaluating and analyzing Linux-tiny.

Linux-tiny specific core member

  • Classified by Name
    • Chihiro Morita(Mitsubishi) / Step 3
    • Richard Griffiths(intel) / Step 1 and 2
    • M Ranga Swami Reddy(sankhya) / Step 1
    • Keijiro Yano(Toshiba) / Step 3
    • Masahiro Fukuda(NEC Electronics) / Step 2
    • Shuduo Sang(Monta Vista) / Step 1 , 2 and 3
  • Classified by Steps
    • Step 1 Richard Griffiths(intel), M Ranga Swami Reddy(sankhya),ShuduoSang(MontaVista)
    • Step 2 Richard Griffiths(intel), Masahiro Fukuda(NEC Electronics), ShuduoSang(MontaVista)
    • Step 3 Chihiro Morita(Mitsubishi), Keijiro Yano(Toshiba), ShuduoSang(MontaVista)


Step1

Scope and objective

  • Step1 is to develop automated testing (config-->build-->capture size) framework on PC/Linux platform.

Specification on the framework(tentative)

  • given the following directory structure:
input/... = input directory = environment var INPUT_DIR
has baseline_config file
linux-2.6.8.1/... = kernel source directory = environment var KERN_SRC
results/... = output directory = environment var RESULT_DIR
  • variable iteration:
for CONFIG_VAR in `cat $(INPUT_DIR)/varlist`; do <loop body here> ; done
  • Automated flow control for the following operation assuming individual CONFIG vars are given by Step2.
    1. copy baseline_config to .config
      • cp ../$(INPUT_DIR)/baseline_config .config
    2. turn on that variable in the .config file
      • may need to strip current definition of CONFIG_FOO from .config file)
      • echo "CONFIG_FOO=y" >>.config
    3. make sure configuration is consistent (turn on dependent configuration options)
      • yes | make oldconfig
    4. save a diff between .config and baseline_config
      • diff -u $RESULT_DIR/baseline_config .config *#*>../$(RESULT_DIR)/$(CONFIG_VAR).config.patch
    5. build kernel image
    6. make vmlinux
    7. save results
      • echo $(CONFIG_VAR) >>../$(RESULT_DIR)/size_results
      • size vmlinux >>../$(RESULT_DIR)/size_results
      • (sub-system size measurements from linux-tiny presentation by Matt Mackall)
      • echo ==================================== >>../$(RESULT_DIR)/size_results
    8. cleanup for next loop iteration, if necessary
      • make clean (is this needed?)
    9. repeat

Step2

  • pre-requisite (manual tasks):
  1. build a list of individual CONFIG vars to test
  2. create a baseline_config file
  3. kernel source for your platform
  4. provide environment to run automated script, consisting of:
  • directories mentioned above: {{{input, results, <linux kernel source}}}
  • environment variables for script: {{{INPUT_DIR, RESULT_DIR, KERN_SRC}}}
  • environment variables for kernel building: {{{ARCH, CROSS_COMPILE, PATH}}}
  1. measure size of kernel compiled with baseline_config
  2. if the build is cleaned out between every compile, it may be desirable to have ccache installed - see http://ccache.samba.org/

Rationale

[This feature is important because ...]

Resources

Projects

Specifications

None

Downloads

Patch

Utility programs

[other programs, user-space, test, etc. related to this technology]

Linux Tiny Kernel Size Script

How To Use

Sample Results

[Examples of use with measurement of the effects.]

Case Study 1

On RBTX4938 board (MIPS architecture):

Linux-tiny size mips.png

Case Study 2

Future Work/Action Items

Here is a list of things that could be worked on for this feature:  ??