Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Stress-testing the Linux kernel

By Robert Williamson
2005-04-19


Analyzing Kernel Code Coverage

Achieving adequate kernel coverage is another responsibility of a system stress test. Although the chosen combination of tests extensively utilizes the four main resources, it may only be executing a small subset of the kernel. Thus, you should analyze coverage to ensure that the combination lends itself to being a system stress test, and not a system load generator. Currently, two open source tools can help in code coverage analysis of the Linux kernel:

• gcov: An open source tool maintained by the Linux Test Project. This tool analyzes the coverage of the kernel, and reports what lines, functions, and branches are covered and how many times they were hit.
• lcov: An open source tool developed by IBM and maintained by the Linux Test Project. This tool consists of a set of Perl scripts that build on the text-based gcov output to implement HTML-based output. The output includes coverage percentages, graphs, and overview pages that allow quick browsing of coverage data. You can find both tools at the Linux Test Project (LTP) home page (see Resources for a link).

After the gcov module is loaded, all tests run in the system stress test combination must be executed. Although the original system stress test can and should have concurrent executions, this run should be iterative. Each test should be run once to completion, one after another, without repetition of any test. The single, iterative run is an attempt to reduce the amount of unpredictable and untargeted kernel code executions that result from the kernel's attempt to load balance the multiple, concurrent runs of the system stress test. You should run the gcov analysis after the conclusion of the final test run. As the final step in formulating the data for analysis, run the lcov tool and unload the gcov module.

The lcov tool generates an entire HTML tree that contains every line of code in the kernel and data on how many times, if any, each line was executed. The tool quantifies the coverage data and generates coverage percentage numbers for each section and file of the kernel. The following example show a sample code coverage output:

Figure 1. Example of gcov output


The lcov maintainers defined "adequate coverage" (green), and thus the lcov example is just an opinion. However, the included raw data allows any reviewer to make his or her own judgment. The test creator can now make changes to the combination of tests after reviewing the coverage analysis, to change and/or increase the amount of code covered.


Tutorial Pages:
» A Design Process for Standardized Testing of Linux
» Selecting Tests
» Evaluating System Resource Utilization
» Analyzing Kernel Code Coverage
» Evaluating the Final Stress Test
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» How to Install PHP 5 on Linux
» How to Install Apache 2 on Linux
» How to Install MySQL 5.0 on Linux
» SMB Caching
» Mound --Bind
» Tar Wild Card Interpretation