How is the Linux kernel tested ?

前端 未结 13 1801
轻奢々
轻奢々 2020-11-30 15:50

How do the Linux kernel developers test their code locally and after they have it committed? Do they use some kind of unit testing, build automation? test plans?

13条回答
  •  盖世英雄少女心
    2020-11-30 16:56

    Its not very easy to automate kernel testing. Most Linux developers do the testing on their own, much like adobriyan mentioned.

    However, there are a few things that help with debugging the Linux Kernel:

    • kexec: A system call that allows you to put another kernel into memory and reboot without going back to the BIOS, and if it fails, reboot back.
    • dmesg: Definitely the place to look for information about what happened during the kernel boot and whether it works/doesn't work.
    • Kernel Instrumentation: In addition to printk's (and an option called 'CONFIG_PRINTK_TIME' which allows you to see (to microsecond accuracy) when the kernel output what), the kernel configuration allows you to turn on a LOT of tracers that enable them to debug what is happening.

    Then, developers usually have others review their patches. Once the patches are reviewed locally and seen not to interfere with anything else, and the patches are tested to work with the latest kernel from Linus without breaking anything, the patches are pushed upstream.

    Edit: Here's a nice video detailing the process a patch goes through before it is integrated into the kernel.

提交回复
热议问题