Lines Matching +full:data +full:- +full:out
5 tool gcov_ with the Linux kernel. Coverage data of a running kernel
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
15 as lcov_ can be used to automate the process of collecting data
30 -----------
37 and to get coverage data for the entire kernel::
45 Profiling data will only become accessible once debugfs has been
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 -----
84 Parent directory for all gcov-related files.
87 Global reset file: resets all coverage data to zero when
91 The actual gcov data file as understood by the gcov
92 tool. Resets file coverage data to zero when written to.
95 Symbolic link to a static data file required by the gcov
97 option ``-ftest-coverage``.
101 -------
105 coverage data for such code by keeping a copy of the data associated
106 with the unloaded module. This data remains available through debugfs.
108 initialized with the data from its previous instantiation.
115 At run-time, a user can also choose to discard data for an unloaded
116 module by writing to its data file or the global reset file.
120 ---------------------------------
122 The gcov kernel profiling infrastructure is designed to work out-of-the
134 - all C source files + headers
137 - all C source files + headers
138 - all .gcda and .gcno files
139 - all links to directories
152 - all .gcda files
153 - all links to .gcno files
156 must then be called with the -o option pointing to that directory.
161 /tmp/out: kernel build directory as specified by make O=
164 [user@build] cd /tmp/out
165 [user@build] gcov -o /tmp/coverage/tmp/out/init main.c
169 -----------------
172 GCC-generated .gcno and .gcda files, and use llvm-cov_ for Clang.
175 .. _llvm-cov: https://llvm.org/docs/CommandGuide/llvm-cov.html
183 ---------------
206 Use ``cat``' to read ``.gcda`` files and ``cp -d`` to copy links.
211 ------------------------------
216 .. code-block:: sh
224 if [ -z "$KSRC" ] || [ -z "$KOBJ" ] || [ -z "$DEST" ]; then
229 KSRC=$(cd $KSRC; printf "all:\n\t@echo \${CURDIR}\n" | make -f -)
230 KOBJ=$(cd $KOBJ; printf "all:\n\t@echo \${CURDIR}\n" | make -f -)
232 find $KSRC $KOBJ \( -name '*.gcno' -o -name '*.[ch]' -o -type l \) -a \
233 -perm /u+r,g+r | tar cfz $DEST -P -T -
235 if [ $? -eq 0 ] ; then
237 echo " tar xfz $DEST -P"
244 -----------------------------
246 Sample script to gather coverage data files on the test machine
249 .. code-block:: sh
251 #!/bin/bash -e
256 if [ -z "$DEST" ] ; then
261 TEMPDIR=$(mktemp -d)
262 echo Collecting data..
263 find $GCDA -type d -exec mkdir -p $TEMPDIR/\{\} \;
264 find $GCDA -name '*.gcda' -exec sh -c 'cat < $0 > '$TEMPDIR'/$0' {} \;
265 find $GCDA -name '*.gcno' -exec sh -c 'cp -d $0 '$TEMPDIR'/$0' {} \;
266 tar czf $DEST -C $TEMPDIR sys
267 rm -rf $TEMPDIR