From: Peter O. <obe...@us...> - 2007-03-07 14:59:35
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5366 Modified Files: geninfo lcov Log Message: lcov: - add --ignore-errors option to lcov/geninfo - add --gcov-tool option to lcov/geninfo - remove s390 test case modification in geninfo - restructured help text for lcov/geninfo Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** geninfo 8 Jan 2007 17:07:21 -0000 1.27 --- geninfo 7 Mar 2007 14:59:25 -0000 1.28 *************** *** 67,70 **** --- 67,73 ---- our $COMPAT_HAMMER = "hammer"; + our $ERROR_GCOV = 0; + our $ERROR_SOURCE = 1; + # Prototypes sub print_usage(*); *************** *** 106,113 **** our $preserve_paths; our $compat_libtool; ! our $adjust_testname = (`uname -m` =~ /^s390/); # Always on on s390 our $config; # Configuration file contents our $compatibility; # Compatibility version flag - used to indicate # non-standard GCOV data format versions our $cwd = `pwd`; --- 109,118 ---- our $preserve_paths; our $compat_libtool; ! our $adjust_testname; our $config; # Configuration file contents our $compatibility; # Compatibility version flag - used to indicate # non-standard GCOV data format versions + our @ignore_errors; # List of errors to ignore (parameter) + our @ignore; # List of errors to ignore (array) our $cwd = `pwd`; *************** *** 150,154 **** "help" => \$help, "follow" => \$follow, ! "compat_libtool" => \$compat_libtool )) { --- 155,161 ---- "help" => \$help, "follow" => \$follow, ! "compat-libtool" => \$compat_libtool, ! "gcov-tool=s" => \$gcov_tool, ! "ignore-errors=s" => \@ignore_errors )) { *************** *** 179,183 **** } ! # Adjust test name if necessary (standard for s390 architecture) if ($adjust_testname) { --- 186,190 ---- } ! # Adjust test name to include uname output if requested if ($adjust_testname) { *************** *** 221,224 **** --- 228,256 ---- } + if (@ignore_errors) + { + my @expanded; + my $error; + + # Expand comma-separated entries + foreach (@ignore_errors) { + if (/,/) + { + push(@expanded, split(",", $_)); + } + else + { + push(@expanded, $_); + } + } + + foreach (@expanded) + { + /^gcov$/ && do { $ignore[$ERROR_GCOV] = 1; next; } ; + /^source$/ && do { $ignore[$ERROR_SOURCE] = 1; next; }; + die("ERROR: unknown argument for --ignore-errors: $_\n"); + } + } + if (system_no_output(3, $gcov_tool, "--help") == -1) { *************** *** 308,312 **** -n, --no-checksum Do not calculate checksum for each line -b, --base-directory DIR Use DIR as base directory for relative paths ! --compat_libtool Assume libtool environment See $lcov_url for more information about this tool. --- 340,346 ---- -n, --no-checksum Do not calculate checksum for each line -b, --base-directory DIR Use DIR as base directory for relative paths ! --compat-libtool Assume libtool environment ! --gcov-tool TOOL Specify gcov tool location ! --ignore-errors ERROR Continue after ERROR (gcov, source) See $lcov_url for more information about this tool. *************** *** 547,551 **** } ! $gcov_error and die("ERROR: GCOV failed for $da_filename!\n"); # Collect data from resulting .gcov files and create .info file --- 581,593 ---- } ! if ($gcov_error) ! { ! if ($ignore[$ERROR_GCOV]) ! { ! warn("WARNING: GCOV failed for $da_filename!\n"); ! return; ! } ! die("ERROR: GCOV failed for $da_filename!\n"); ! } # Collect data from resulting .gcov files and create .info file *************** *** 590,593 **** --- 632,639 ---- { ($source, $object) = read_gcov_header($gcov_file); + if (!defined($source)) + { + next; + } if ($source) *************** *** 601,604 **** --- 647,656 ---- if (defined($source) && ! -r $source && ! $nochecksum) { + if ($ignore[$ERROR_SOURCE]) + { + warn("WARNING: could not read source file ". + "$source\n"); + next; + } die("ERROR: could not read source file $source\n"); } *************** *** 925,930 **** local *INPUT; ! open(INPUT, $_[0]) ! or die("ERROR: cannot read $_[0]!\n"); while (<INPUT>) --- 977,989 ---- local *INPUT; ! if (!open(INPUT, $_[0])) ! { ! if ($ignore_errors[$ERROR_GCOV]) ! { ! warn("WARNING: cannot read $_[0]!\n"); ! return (undef,undef); ! } ! die("ERROR: cannot read $_[0]!\n"); ! } while (<INPUT>) Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** lcov 8 Jan 2007 17:07:21 -0000 1.17 --- lcov 7 Mar 2007 14:59:25 -0000 1.18 *************** *** 149,152 **** --- 149,154 ---- our $base_directory; # Base directory (cwd of gcc during compilation) our $compat_libtool; # Specify to work with libtool build environment + our $gcov_tool; + our $ignore_errors; our $config; # Configuration file contents chomp($cwd); *************** *** 206,210 **** "path=s" => \$diff_path, "base-directory=s" => \$base_directory, ! "compat_libtool" => \$compat_libtool )) { --- 208,214 ---- "path=s" => \$diff_path, "base-directory=s" => \$base_directory, ! "compat-libtool" => \$compat_libtool, ! "gcov-tool=s" => \$gcov_tool, ! "ignore-errors=s" => \$ignore_errors )) { *************** *** 329,337 **** --- 333,350 ---- get coverage data for a user space program. + Misc: -h, --help Print this help, then exit -v, --version Print version number, then exit -q, --quiet Do not print progress messages + + Operation: -z, --zerocounters Reset all execution counts to zero -c, --capture Capture coverage data + -a, --add-tracefile FILE Add contents of tracefiles + -e, --extract FILE PATTERN Extract files matching PATTERN from FILE + -r, --remove FILE PATTERN Remove files matching PATTERN from FILE + -l, --list FILE List contents of tracefile FILE + + Options: -t, --test-name NAME Specify test name to be stored with data -o, --output-file FILENAME Write data to FILENAME instead of stdout *************** *** 339,346 **** -f, --follow Follow links when searching .da files -k, --kernel-directory KDIR Capture kernel coverage data only from KDIR - -a, --add-tracefile FILE Add contents of tracefiles - -e, --extract FILE PATTERN Extract files matching PATTERN from FILE - -r, --remove FILE PATTERN Remove files matching PATTERN from FILE - -l, --list FILE List contents of tracefile FILE -b, --base-directory DIR Use DIR as base directory for relative paths --diff FILE DIFF Transform tracefile FILE according to DIFF --- 352,355 ---- *************** *** 349,353 **** --strip DEPTH Strip initial DEPTH directory levels in diff --path PATH Strip PATH from tracefile when applying diff ! --compat_libtool Assume libtool environment See $lcov_url for more information about this tool. --- 358,364 ---- --strip DEPTH Strip initial DEPTH directory levels in diff --path PATH Strip PATH from tracefile when applying diff ! --compat-libtool Assume libtool environment ! --gcov-tool TOOL Specify gcov tool location ! --ignore-errors ERROR Continue after ERROR (gcov, source) See $lcov_url for more information about this tool. *************** *** 469,473 **** if ($compat_libtool) { ! @param = (@param, "--compat_libtool"); } --- 480,492 ---- if ($compat_libtool) { ! @param = (@param, "--compat-libtool"); ! } ! if ($gcov_tool) ! { ! @param = (@param, "--gcov-tool", $gcov_tool); ! } ! if ($ignore_errors) ! { ! @param = (@param, "--ignore-errors", $ignore_errors); } *************** *** 595,598 **** --- 614,621 ---- @param = (@param, "--no-checksum"); } + if ($gcov_tool) + { + @param = (@param, "--gcov-tool", $gcov_tool); + } system(@param) and exit($? >> 8); |