Lines Matching +full:build +full:- +full:in

6 is exported in gcov-compatible format via the "gcov" debugfs directory.
7 To get coverage data for a specific file, change to the kernel build
8 directory and use gcov with the ``-o`` option as follows (requires root)::
10 # cd /tmp/linux-out
11 # gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c
14 in the current directory. In addition, graphical gcov front-ends such
16 for the entire kernel and provide coverage overviews in HTML format.
26 .. _lcov: https://github.com/linux-test-project/lcov
30 -----------
48 mount -t debugfs none /sys/kernel/debug
52 -------------
57 - For a single file (e.g. main.o)::
61 - For all files in one directory::
79 -----------------------
90 -----
92 The gcov kernel support creates the following files in debugfs:
95 Parent directory for all gcov-related files.
108 option ``-ftest-coverage``.
112 -------
126 At run-time, a user can also choose to discard data for an unloaded
130 Separated build and test machines
131 ---------------------------------
133 The gcov kernel profiling infrastructure is designed to work out-of-the
134 box for setups where kernels are built and run on the same machine. In
138 .. _gcov-test:
143 gcc version used for kernel build. Also the following files need to be
144 copied from build to test machine:
147 - all C source files + headers
149 from the build tree:
150 - all C source files + headers
151 - all .gcda and .gcno files
152 - all links to directories
155 exact same file system location on the test machine as on the build
159 .. _gcov-build:
161 b) gcov is run on the BUILD machine
164 to build machine:
166 from the gcov directory in sysfs:
167 - all .gcda files
168 - all links to .gcno files
170 These files can be copied to any location on the build machine. gcov
171 must then be called with the -o option pointing to that directory.
173 Example directory setup on the build machine::
176 /tmp/out: kernel build directory as specified by make O=
179 [user@build] cd /tmp/out
180 [user@build] gcov -o /tmp/coverage/tmp/out/init main.c
184 -----------------
187 GCC-generated .gcno and .gcda files, and use llvm-cov_ for Clang.
190 .. _llvm-cov: https://llvm.org/docs/CommandGuide/llvm-cov.html
192 Build differences between GCC and Clang gcov are handled by Kconfig. It
198 ---------------
210 ``GCOV_PROFILE := n`` or ``GCOV_PROFILE_basename.o := n`` in the
221 Use ``cat`` to read ``.gcda`` files and ``cp -d`` to copy links.
222 Alternatively use the mechanism shown in Appendix B.
226 ------------------------------
228 Sample script to gather coverage meta files on the build machine
229 (see :ref:`Separated build and test machines a. <gcov-test>`):
231 .. code-block:: sh
239 if [ -z "$KSRC" ] || [ -z "$KOBJ" ] || [ -z "$DEST" ]; then
244 KSRC=$(cd $KSRC; printf "all:\n\t@echo \${CURDIR}\n" | make -f -)
245 KOBJ=$(cd $KOBJ; printf "all:\n\t@echo \${CURDIR}\n" | make -f -)
247 find $KSRC $KOBJ \( -name '*.gcno' -o -name '*.[ch]' -o -type l \) -a \
248 -perm /u+r,g+r | tar cfz $DEST -P -T -
250 if [ $? -eq 0 ] ; then
252 echo " tar xfz $DEST -P"
259 -----------------------------
262 (see :ref:`Separated build and test machines b. <gcov-build>`):
264 .. code-block:: sh
266 #!/bin/bash -e
271 if [ -z "$DEST" ] ; then
276 TEMPDIR=$(mktemp -d)
278 find $GCDA -type d -exec mkdir -p $TEMPDIR/\{\} \;
279 find $GCDA -name '*.gcda' -exec sh -c 'cat < $0 > '$TEMPDIR'/$0' {} \;
280 find $GCDA -name '*.gcno' -exec sh -c 'cp -d $0 '$TEMPDIR'/$0' {} \;
281 tar czf $DEST -C $TEMPDIR sys
282 rm -rf $TEMPDIR
284 echo "$DEST successfully created, copy to build system and unpack with:"