Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:gcov—a Test Coverage Program   [Contents][Index]


11.5 Data File Relocation to Support Cross-Profiling

Running the program will cause profile output to be generated. For eachsource file compiled with-fprofile-arcs, an accompanying.gcdafile will be placed in the object file directory. That implicitly requiresrunning the program on the same system as it was built or having the sameabsolute directory structure on the target system. The program will tryto create the needed directory structure, if it is not already present.

To support cross-profiling, a program compiled with-fprofile-arcscan relocate the data files based on two environment variables:

For example, if the object file/user/build/foo.o was built with-fprofile-arcs, the final executable will try to create the data file/user/build/foo.gcda when running on the target system. This willfail if the corresponding directory does not exist and it is unable to createit. This can be overcome by, for example, setting the environment as‘GCOV_PREFIX=/target/run’ and ‘GCOV_PREFIX_STRIP=1’. Such asetting will name the data file/target/run/build/foo.gcda.

You must move the data files to the expected directory tree in order touse them for profile directed optimizations (-fprofile-use), or touse thegcov tool.


Next:Profiling and Test Coverage in Freestanding Environments, Previous:Brief Description ofgcov Data Files, Up:gcov—a Test Coverage Program   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp