OLD | NEW |
1 ------------------------------------------------- | 1 ------------------------------------------------- |
2 - README file for the LTP GCOV extension (LCOV) - | 2 - README file for the LTP GCOV extension (LCOV) - |
3 - Last changes: 2008-11-17 - | 3 - Last changes: 2012-10-10 - |
4 ------------------------------------------------- | 4 ------------------------------------------------- |
5 | 5 |
6 Description | 6 Description |
7 ----------- | 7 ----------- |
8 LCOV is an extension of GCOV, a GNU tool which provides information about | 8 LCOV is an extension of GCOV, a GNU tool which provides information about |
9 what parts of a program are actually executed (i.e. "covered") while running | 9 what parts of a program are actually executed (i.e. "covered") while running |
10 a particular test case. The extension consists of a set of PERL scripts | 10 a particular test case. The extension consists of a set of Perl scripts |
11 which build on the textual GCOV output to implement the following enhanced | 11 which build on the textual GCOV output to implement the following enhanced |
12 functionality: | 12 functionality: |
13 | 13 |
14 * HTML based output: coverage rates are additionally indicated using bar | 14 * HTML based output: coverage rates are additionally indicated using bar |
15 graphs and specific colors. | 15 graphs and specific colors. |
16 | 16 |
17 * Support for large projects: overview pages allow quick browsing of | 17 * Support for large projects: overview pages allow quick browsing of |
18 coverage data by providing three levels of detail: directory view, | 18 coverage data by providing three levels of detail: directory view, |
19 file view and source code view. | 19 file view and source code view. |
20 | 20 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 make install | 73 make install |
74 | 74 |
75 | 75 |
76 3. An example of how to access kernel coverage data | 76 3. An example of how to access kernel coverage data |
77 --------------------------------------------------- | 77 --------------------------------------------------- |
78 Requirements: get and install the gcov-kernel package from | 78 Requirements: get and install the gcov-kernel package from |
79 | 79 |
80 http://sourceforge.net/projects/ltp | 80 http://sourceforge.net/projects/ltp |
81 | 81 |
82 Copy the resulting gcov kernel module file to either the system wide modules | 82 Copy the resulting gcov kernel module file to either the system wide modules |
83 directory or the same directory as the PERL scripts. As root, do the following: | 83 directory or the same directory as the Perl scripts. As root, do the following: |
84 | 84 |
85 a) Resetting counters | 85 a) Resetting counters |
86 | 86 |
87 lcov --zerocounters | 87 lcov --zerocounters |
88 | 88 |
89 b) Capturing the current coverage state to a file | 89 b) Capturing the current coverage state to a file |
90 | 90 |
91 lcov --capture --output-file kernel.info | 91 lcov --capture --output-file kernel.info |
92 | 92 |
93 c) Getting HTML output | 93 c) Getting HTML output |
94 | 94 |
95 genhtml kernel.info | 95 genhtml kernel.info |
96 | 96 |
97 Point the web browser of your choice to the resulting index.html file. | 97 Point the web browser of your choice to the resulting index.html file. |
98 | 98 |
99 | 99 |
100 4. An example of how to access coverage data for a user space program | 100 4. An example of how to access coverage data for a user space program |
101 --------------------------------------------------------------------- | 101 --------------------------------------------------------------------- |
102 Requirements: compile the program in question using GCC with the options | 102 Requirements: compile the program in question using GCC with the options |
103 -fprofile-arcs and -ftest-coverage. Assuming the compile directory is called | 103 -fprofile-arcs and -ftest-coverage. During linking, make sure to specify |
104 "appdir", do the following: | 104 -lgcov or -coverage. |
| 105 |
| 106 Assuming the compile directory is called "appdir", do the following: |
105 | 107 |
106 a) Resetting counters | 108 a) Resetting counters |
107 | 109 |
108 lcov --directory appdir --zerocounters | 110 lcov --directory appdir --zerocounters |
109 | 111 |
110 b) Capturing the current coverage state to a file (works only after the | 112 b) Capturing the current coverage state to a file (works only after the |
111 application has been started and stopped at least once) | 113 application has been started and stopped at least once) |
112 | 114 |
113 lcov --directory appdir --capture --output-file app.info | 115 lcov --directory appdir --capture --output-file app.info |
114 | 116 |
115 c) Getting HTML output | 117 c) Getting HTML output |
116 | 118 |
117 genhtml app.info | 119 genhtml app.info |
118 | 120 |
119 Point the web browser of your choice to the resulting index.html file. | 121 Point the web browser of your choice to the resulting index.html file. |
120 | 122 |
| 123 Please note that independently of where the application is installed or |
| 124 from which directory it is run, the --directory statement needs to |
| 125 point to the directory in which the application was compiled. |
| 126 |
| 127 For further information on the gcc profiling mechanism, please also |
| 128 consult the gcov man page. |
| 129 |
121 | 130 |
122 5. Questions and comments | 131 5. Questions and comments |
123 ------------------------- | 132 ------------------------- |
124 See the included man pages for more information on how to use the LCOV tools. | 133 See the included man pages for more information on how to use the LCOV tools. |
125 | 134 |
126 Please email further questions or comments regarding this tool to the | 135 Please email further questions or comments regarding this tool to the |
127 LTP Mailing list at ltp-coverage@lists.sourceforge.net | 136 LTP Mailing list at ltp-coverage@lists.sourceforge.net |
128 | 137 |
OLD | NEW |