Lines Matching +full:test +full:- +full:docs

6 is exported in gcov-compatible format via the "gcov" debugfs directory.
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
21 * test improvement (how do I change my test to cover these lines?)
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 -----
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
138 .. _gcov-test:
140 a) gcov is run on the TEST machine
142 The gcov tool version on the test machine must be compatible with the
144 copied from build to test machine:
147 - all C source files + headers
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:
163 The following files need to be copied after each test case from test
167 - all .gcda files
168 - all links to .gcno files
171 must then be called with the -o option pointing to that directory.
177 /tmp/coverage: location of the files copied from the test machine
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
198 ---------------
221 Use ``cat`` to read ``.gcda`` files and ``cp -d`` to copy links.
226 ------------------------------
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
251 echo "$DEST successfully created, copy to test system and unpack with:"
252 echo " tar xfz $DEST -P"
259 -----------------------------
261 Sample script to gather coverage data files on the test machine
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