aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 01488dbf1a0ea629d3651e90f5bebe8a37b1225f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Intruduction to kbuild test script

* Basic

This script makes it a bit easier to detect kernel build problems by
automatically run build tests with various configrations.

What the script actually does is
    - scan each commit from your repository tree, and find out
      CONFIG_* symbols that should be tested
    - enumarate all the combination of such config symbols at each commit,
      and generate buildable configuration files
    - run all the testcases automatically and report the results

The script must be run on top of your local repository, with a branch
to be tested checkouted.


* Output(log) directory

The default top directory is /tmp, and the script create an instace with
a unique name.

    /tmp/201510281441_15033/
            allconfigs : list of all parameterized config symbols
            params     : test environment
            results    : summary of test results
            a26be1e/   : commit a26be1e
                1/
                    kernel_config        : test pattern of configs
                    kernel_config_build  : generated config file
                    config.log           : log for configration
                    build.log            : log for build test
                    clean.log            : log for clean up
                2/ (ditto)
            26204f3/ (ditto)


* Typical usage & example

    # set up, and run build tests from HEAD~7 to HEAD
    $ kbuildtest.sh -A arm64 -C aarch64-linux-gnu- -v HEAD~7
or
    # only set up environment,
    $ kbuildtest.sh -A arm64 -C aarch64-linux-gnu- -v -n HEAD~7

    # review a generated param file and configration files
    # if necessary, modify them,
    # then run build tests
    $ kbuildtest.sh -v -p /tmp/<logdir>/params

In my case[1], the script extracted the config symbols below:
    CONFIG_FRAME_POINTER
    CONFIG_DYNAMIC_FTRACE
    CONFIG_FUNCTION_GRAPH_TRACER
    CONFIG_STACK_TRACER

we don't need to test CONFIG_FRAME_POINTER, while we had to add CONFIG_FTRACE
and CONFIG_FUNCTION_TACER explicitly in order to enable CONFIG_DYNAMIC_FTRACE
and CONFIG_FUNCTION_GRAPH_TRACER.
(Please note that the script does not automatically recognize such dependencies in Kconfigs.)

So let's do the following,
    $ kbuildtest.sh -A arm64 -C aarch64-linux-gnu- \
            -a FTRACE,FUNCTION_TRACER -e FRAME_POINTER HEAD~7

Instead, we may want to do,
    $ kbuildtest.sh -A arm64 -C aarch64-linux-gnu- \
            -a FTRACE -i FUNCTION_TRACER -e FRAME_POINTER HEAD~7

While "-a" always turn on the config symbol, "-i" puts it into a set of configs
to be tested, then we will see more variants of configration. This means that,
even if the script fails to detect any usable config symbols, you can add ones
manually to the list.

You may also modify a "kernel_config" file and, even more, add more test
patterns under a <commit> directory. 
(You are required to remove "kernel_config_build" if you modify a
"kernel_config.")


* Known issues

- "-o" with multiple items, like "-o Image dtbs" doesn't work.
  [workaround]
     Use a comma-separated list, say, "-o Image,dtbs"


* References

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/375503.html