You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(205) |
Feb
(281) |
Mar
(428) |
Apr
(444) |
May
(137) |
Jun
(341) |
Jul
(509) |
Aug
(184) |
Sep
(51) |
Oct
(70) |
Nov
(52) |
Dec
(41) |
2004 |
Jan
(27) |
Feb
|
Mar
|
Apr
(99) |
May
(562) |
Jun
(36) |
Jul
(74) |
Aug
(61) |
Sep
(33) |
Oct
(76) |
Nov
(64) |
Dec
(71) |
2005 |
Jan
(19) |
Feb
(28) |
Mar
(726) |
Apr
(310) |
May
(325) |
Jun
(496) |
Jul
(192) |
Aug
(72) |
Sep
(41) |
Oct
(294) |
Nov
(79) |
Dec
(64) |
2006 |
Jan
(112) |
Feb
(267) |
Mar
(33) |
Apr
(16) |
May
(121) |
Jun
(77) |
Jul
(43) |
Aug
(281) |
Sep
(97) |
Oct
(19) |
Nov
(15) |
Dec
(50) |
2007 |
Jan
(2) |
Feb
(31) |
Mar
(21) |
Apr
(76) |
May
(36) |
Jun
(97) |
Jul
(93) |
Aug
(85) |
Sep
(77) |
Oct
(35) |
Nov
(106) |
Dec
(81) |
2008 |
Jan
(86) |
Feb
(139) |
Mar
(378) |
Apr
(127) |
May
(196) |
Jun
(108) |
Jul
(136) |
Aug
(137) |
Sep
(114) |
Oct
(229) |
Nov
(312) |
Dec
(180) |
2009 |
Jan
(747) |
Feb
(907) |
Mar
(371) |
Apr
(174) |
May
(192) |
Jun
(163) |
Jul
(744) |
Aug
(495) |
Sep
(85) |
Oct
(950) |
Nov
(311) |
Dec
(180) |
2010 |
Jan
(303) |
Feb
(33) |
Mar
(9) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(18) |
Aug
(37) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(3) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(17) |
Nov
(1) |
Dec
|
2013 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
2016 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Peter O. <obe...@us...> - 2012-07-18 12:56:23
|
Update of /cvsroot/ltp/utils/analysis/lcov In directory vz-cvs-4.sog:/tmp/cvs-serv16102 Modified Files: lcovrc Log Message: lcovrc: add description for geninfo_compat setting Index: lcovrc =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/lcovrc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** lcovrc 31 Aug 2010 08:17:23 -0000 1.16 --- lcovrc 18 Jul 2012 12:56:21 -0000 1.17 *************** *** 112,115 **** --- 112,118 ---- #geninfo_gcov_all_blocks = 1 + # Specify compatiblity modes (same as --compat option of geninfo). + #geninfo_compat = libtool=on, hammer=auto, split_crc=auto + # Directory containing gcov kernel files # lcov_gcov_dir = /proc/gcov |
From: Peter O. <obe...@us...> - 2012-07-18 12:40:58
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory vz-cvs-4.sog:/tmp/cvs-serv13506/man Modified Files: geninfo.1 lcov.1 Log Message: lcov: improve --compat description Index: geninfo.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/geninfo.1,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** geninfo.1 18 Jul 2012 12:13:00 -0000 1.21 --- geninfo.1 18 Jul 2012 12:40:56 -0000 1.22 *************** *** 151,155 **** .B \-\-compat ! .IR mode = value .br .RS --- 151,155 ---- .B \-\-compat ! .IR mode = value [, mode = value ,...] .br .RS *************** *** 157,161 **** Use \-\-compat to specify that geninfo should enable one or more compatibility ! modes when capturing coverage data. Valid .I values are: --- 157,164 ---- Use \-\-compat to specify that geninfo should enable one or more compatibility ! modes when capturing coverage data. You can provide a comma-separated list ! of mode=value pairs to specify the values for multiple modes. ! ! Valid .I values are: *************** *** 175,178 **** --- 178,183 ---- .RE + If no value is specified, 'on' is assumed as default value. + Valid .I modes Index: lcov.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/lcov.1,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** lcov.1 18 Jul 2012 12:13:00 -0000 1.27 --- lcov.1 18 Jul 2012 12:40:56 -0000 1.28 *************** *** 303,307 **** .B \-\-compat ! .IR mode = value .br .RS --- 303,307 ---- .B \-\-compat ! .IR mode = value [, mode = value ,...] .br .RS *************** *** 309,313 **** Use \-\-compat to specify that lcov should enable one or more compatibility ! modes when capturing coverage data. Valid .I values are: --- 309,316 ---- Use \-\-compat to specify that lcov should enable one or more compatibility ! modes when capturing coverage data. You can provide a comma-separated list ! of mode=value pairs to specify the values for multiple modes. ! ! Valid .I values are: *************** *** 327,330 **** --- 330,335 ---- .RE + If no value is specified, 'on' is assumed as default value. + Valid .I modes |
From: Peter O. <obe...@us...> - 2012-07-18 12:13:02
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory vz-cvs-4.sog:/tmp/cvs-serv11905/man Modified Files: geninfo.1 lcov.1 Log Message: lcov: add missing documentation for --compat option Add missing sections in the geninfo and lcov man-pages for the newly introduced command line option --compat. Also set the default value for the hammer compatibility mode to 'auto' to keep the behavior of previous releases. Index: geninfo.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/geninfo.1,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** geninfo.1 19 Nov 2010 16:33:25 -0000 1.20 --- geninfo.1 18 Jul 2012 12:13:00 -0000 1.21 *************** *** 41,44 **** --- 41,46 ---- .br .RB [ \-\-derive\-func\-data ] + .RB [ \-\-compat + .IR mode =on|off|auto] .RE .SH DESCRIPTION *************** *** 148,151 **** --- 150,215 ---- .RE + .B \-\-compat + .IR mode = value + .br + .RS + Set compatibility mode. + + Use \-\-compat to specify that geninfo should enable one or more compatibility + modes when capturing coverage data. Valid + .I values + are: + + .B on + .RS + Enable compatibility mode. + .RE + .B off + .RS + Disable compatibility mode. + .RE + .B auto + .RS + Apply auto-detection to determine if compatibility mode is required. Note that + auto-detection is not available for all compatibility modes. + .RE + + Valid + .I modes + are: + + .B libtool + .RS + Enable this mode if you are capturing coverage data for a project that + was built using the libtool mechanism. See also + \-\-compat\-libtool. + + The default value for this setting is 'on'. + + .RE + .B hammer + .RS + Enable this mode if you are capturing coverage data for a project that + was built using a version of GCC 3.3 that contains a modification + (hammer patch) of later GCC versions. You can identify a modified GCC 3.3 + by checking the build directory of your project for files ending in the + extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'. + + The default value for this setting is 'auto'. + + .RE + .B split_crc + .RS + Enable this mode if you are capturing coverage data for a project that + was built using a version of GCC 4.6 that contains a modification + (split function checksums) of later GCC versions. Typical error messages + when running geninfo on coverage data produced by such GCC versions are + \'out of memory' and 'reached unexpected end of file'. + + The default value for this setting is 'auto' + .RE + + .RE + .B \-\-compat\-libtool .br Index: lcov.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/lcov.1,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** lcov.1 17 Jul 2012 11:37:13 -0000 1.26 --- lcov.1 18 Jul 2012 12:13:00 -0000 1.27 *************** *** 45,48 **** --- 45,50 ---- .RB [ \-\-config\-file .IR config\-file ] + .RB [ \-\-compat + .IR mode =on|off|auto] .br .RE *************** *** 72,75 **** --- 74,79 ---- .RB [ \-\-config\-file .IR config\-file ] + .RB [ \-\-compat + .IR mode =on|off|auto] .br .RE *************** *** 298,301 **** --- 302,367 ---- .RE + .B \-\-compat + .IR mode = value + .br + .RS + Set compatibility mode. + + Use \-\-compat to specify that lcov should enable one or more compatibility + modes when capturing coverage data. Valid + .I values + are: + + .B on + .RS + Enable compatibility mode. + .RE + .B off + .RS + Disable compatibility mode. + .RE + .B auto + .RS + Apply auto-detection to determine if compatibility mode is required. Note that + auto-detection is not available for all compatibility modes. + .RE + + Valid + .I modes + are: + + .B libtool + .RS + Enable this mode if you are capturing coverage data for a project that + was built using the libtool mechanism. See also + \-\-compat\-libtool. + + The default value for this setting is 'on'. + + .RE + .B hammer + .RS + Enable this mode if you are capturing coverage data for a project that + was built using a version of GCC 3.3 that contains a modification + (hammer patch) of later GCC versions. You can identify a modified GCC 3.3 + by checking the build directory of your project for files ending in the + extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'. + + The default value for this setting is 'auto'. + + .RE + .B split_crc + .RS + Enable this mode if you are capturing coverage data for a project that + was built using a version of GCC 4.6 that contains a modification + (split function checksums) of later GCC versions. Typical error messages + when running lcov on coverage data produced by such GCC versions are + \'out of memory' and 'reached unexpected end of file'. + + The default value for this setting is 'auto' + .RE + + .RE + .B \-\-compat\-libtool .br |
From: Peter O. <obe...@us...> - 2012-07-18 10:40:15
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv9708 Modified Files: genhtml lcov Log Message: lcov: fix extra closing parenthesis in comment Index: genhtml =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genhtml,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** genhtml 17 Jul 2012 11:37:13 -0000 1.59 --- genhtml 18 Jul 2012 10:40:12 -0000 1.60 *************** *** 5729,5733 **** # returned when HIT is 0. 100 is only returned when HIT equals FOUND. # PRECISION specifies the precision of the result. SUFFIX defines a ! # string that is appended to the result if FOUND is non-zero). Spaces # are added to the start of the resulting string until it is at least WIDTH # characters wide. --- 5729,5733 ---- # returned when HIT is 0. 100 is only returned when HIT equals FOUND. # PRECISION specifies the precision of the result. SUFFIX defines a ! # string that is appended to the result if FOUND is non-zero. Spaces # are added to the start of the resulting string until it is at least WIDTH # characters wide. Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** lcov 17 Jul 2012 11:37:13 -0000 1.84 --- lcov 18 Jul 2012 10:40:12 -0000 1.85 *************** *** 4254,4258 **** # returned when HIT is 0. 100 is only returned when HIT equals FOUND. # PRECISION specifies the precision of the result. SUFFIX defines a ! # string that is appended to the result if FOUND is non-zero). Spaces # are added to the start of the resulting string until it is at least WIDTH # characters wide. --- 4254,4258 ---- # returned when HIT is 0. 100 is only returned when HIT equals FOUND. # PRECISION specifies the precision of the result. SUFFIX defines a ! # string that is appended to the result if FOUND is non-zero. Spaces # are added to the start of the resulting string until it is at least WIDTH # characters wide. |
From: Peter O. <obe...@us...> - 2012-07-17 11:37:15
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory vz-cvs-4.sog:/tmp/cvs-serv30552/man Modified Files: genhtml.1 lcov.1 Log Message: lcov: make 0%/100% exclusive to no/full coverage rate Ensure that coverage rates 0% and 100% are only used when no or all lines/functions/branches are hit respectively. This approach is implemented to allow better identification of boundary cases, and to be in accordance with the behavior of the gcov tool. Based on suggestions by: Pau...@lo... and vi...@vi... Index: genhtml.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/genhtml.1,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** genhtml.1 7 Dec 2010 08:40:09 -0000 1.24 --- genhtml.1 17 Jul 2012 11:37:13 -0000 1.25 *************** *** 90,93 **** --- 90,100 ---- .IR genhtml_hi_limit " and " genhtml_med_limit . + Also note that when displaying percentages, 0% and 100% are only printed when + the values are exactly 0% and 100% respectively. Other values which would + conventionally be rounded to 0% or 100% are instead printed as nearest + non-boundary value. This behavior is in accordance with that of the + .BR gcov (1) + tool. + .SH OPTIONS .B \-h Index: lcov.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/lcov.1,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** lcov.1 24 Aug 2010 16:15:53 -0000 1.25 --- lcov.1 17 Jul 2012 11:37:13 -0000 1.26 *************** *** 194,197 **** --- 194,205 ---- as ".info file" or "tracefile" and that the output of GCOV is called ".da file". + + Also note that when printing percentages, 0% and 100% are only printed when + the values are exactly 0% and 100% respectively. Other values which would + conventionally be rounded to 0% or 100% are instead printed as nearest + non-boundary value. This behavior is in accordance with that of the + .BR gcov (1) + tool. + .SH OPTIONS |
From: Peter O. <obe...@us...> - 2012-07-11 14:09:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv3493 Modified Files: geninfo lcov Log Message: geninfo: more improvements to the .gcno format auto-detection Suggestions by ga...@go...: - rename command line setting - simplify logic Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** geninfo 6 Jul 2012 14:29:27 -0000 1.100 --- geninfo 11 Jul 2012 14:09:27 -0000 1.101 *************** *** 104,108 **** our $COMPAT_MODE_LIBTOOL = 1 << 0; our $COMPAT_MODE_HAMMER = 1 << 1; ! our $COMPAT_MODE_GCC_4_7 = 1 << 2; # Compatibility mode names --- 104,108 ---- our $COMPAT_MODE_LIBTOOL = 1 << 0; our $COMPAT_MODE_HAMMER = 1 << 1; ! our $COMPAT_MODE_SPLIT_CRC = 1 << 2; # Compatibility mode names *************** *** 110,122 **** "libtool" => $COMPAT_MODE_LIBTOOL, "hammer" => $COMPAT_MODE_HAMMER, ! "gcc_4_7" => $COMPAT_MODE_GCC_4_7, ! "android_4_4_0" => $COMPAT_MODE_GCC_4_7, ); # Map modes to names our %COMPAT_MODE_TO_NAME = ( ! $COMPAT_MODE_LIBTOOL => "libtool", ! $COMPAT_MODE_HAMMER => "hammer", ! $COMPAT_MODE_GCC_4_7 => "gcc_4_7", ); --- 110,122 ---- "libtool" => $COMPAT_MODE_LIBTOOL, "hammer" => $COMPAT_MODE_HAMMER, ! "split_crc" => $COMPAT_MODE_SPLIT_CRC, ! "android_4_4_0" => $COMPAT_MODE_SPLIT_CRC, ); # Map modes to names our %COMPAT_MODE_TO_NAME = ( ! $COMPAT_MODE_LIBTOOL => "libtool", ! $COMPAT_MODE_HAMMER => "hammer", ! $COMPAT_MODE_SPLIT_CRC => "split_crc", ); *************** *** 125,129 **** $COMPAT_MODE_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_MODE_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_MODE_GCC_4_7 => $COMPAT_VALUE_AUTO, ); --- 125,129 ---- $COMPAT_MODE_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_MODE_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_MODE_SPLIT_CRC => $COMPAT_VALUE_AUTO, ); *************** *** 132,136 **** our %COMPAT_MODE_AUTO = ( $COMPAT_MODE_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_MODE_GCC_4_7 => 1, # will be done later ); --- 132,136 ---- our %COMPAT_MODE_AUTO = ( $COMPAT_MODE_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_MODE_SPLIT_CRC => 1, # will be done later ); *************** *** 188,191 **** --- 188,192 ---- sub read_gcno_string(*$); sub read_gcno_lines_record(*$$$$$$$); + sub determine_gcno_split_crc($$$); sub read_gcno_function_record(*$$$$$); sub read_gcno($$); *************** *** 241,245 **** our $opt_compat; our %compat_value; ! our $gcno_fmt_4_7; our $cwd = `pwd`; --- 242,246 ---- our $opt_compat; our %compat_value; ! our $gcno_split_crc; our $cwd = `pwd`; *************** *** 548,552 **** --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url --- 549,553 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, split_crc) For more information see: $lcov_url *************** *** 3038,3049 **** # ! # determine_gcno_fmt(handle, big_endian, rec_length) # ! # Determine if HANDLE refers to a .gcno file with a gcc 4.7 format function ! # record. Return non-zero in case of gcc 4.7 format, zero otherwise, ! # undef in case of read error. # ! sub determine_gcno_fmt($$$) { my ($handle, $big_endian, $rec_length) = @_; --- 3039,3050 ---- # ! # determine_gcno_split_crc(handle, big_endian, rec_length) # ! # Determine if HANDLE refers to a .gcno file with a split checksum function ! # record format. Return non-zero in case of split checksum format, zero ! # otherwise, undef in case of read error. # ! sub determine_gcno_split_crc($$$) { my ($handle, $big_endian, $rec_length) = @_; *************** *** 3052,3056 **** return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_MODE_GCC_4_7)); # Heuristic: --- 3053,3057 ---- return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_MODE_SPLIT_CRC)); # Heuristic: *************** *** 3066,3083 **** $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if (!is_compat_auto($COMPAT_MODE_GCC_4_7)) { ! # Sanity check ! if ($overlong_string) { warn("Found overlong string in function record: ". ! "try --compat gcc_4_7\n"); } - return 0; - } elsif (!$overlong_string) { - return 0; } ! info("Auto-detected compatibility mode for GCC 4.7\n"); ! ! return 1; } --- 3067,3084 ---- $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if ($overlong_string) { ! if (is_compat_auto($COMPAT_MODE_SPLIT_CRC)) { ! info("Auto-detected compatibility mode for split ". ! "checksum .gcno file format\n"); ! ! return 1; ! } else { ! # Sanity check warn("Found overlong string in function record: ". ! "try '--compat split_crc'\n"); } } ! return 0; } *************** *** 3100,3111 **** # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! # Determine if this is a gcc 4.7 format function record ! if (!defined($gcno_fmt_4_7)) { ! $gcno_fmt_4_7 = determine_gcno_fmt($handle, $big_endian, ! $rec_length); ! return undef if (!defined($gcno_fmt_4_7)); } ! # Skip cfg checksum word in case of gcc 4.7 format function record ! graph_skip($handle, 4, "function cfg checksum") if ($gcno_fmt_4_7); # Read function name graph_expect("function name"); --- 3101,3112 ---- # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! # Determine if this is a function record with split checksums ! if (!defined($gcno_split_crc)) { ! $gcno_split_crc = determine_gcno_split_crc($handle, $big_endian, ! $rec_length); ! return undef if (!defined($gcno_split_crc)); } ! # Skip cfg checksum word in case of split checksums ! graph_skip($handle, 4, "function cfg checksum") if ($gcno_split_crc); # Read function name graph_expect("function name"); Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** lcov 6 Jul 2012 09:03:27 -0000 1.82 --- lcov 11 Jul 2012 14:09:27 -0000 1.83 *************** *** 525,529 **** --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url --- 525,529 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, split_crc) For more information see: $lcov_url |
From: Peter O. <obe...@us...> - 2012-07-06 14:29:29
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv28201 Modified Files: geninfo Log Message: geninfo: rename compatibility setting to compatibility mode Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** geninfo 6 Jul 2012 09:03:27 -0000 1.99 --- geninfo 6 Jul 2012 14:29:27 -0000 1.100 *************** *** 89,98 **** our $EXCL_LINE = "LCOV_EXCL_LINE"; ! # Compatibility setting values our $COMPAT_VALUE_OFF = 0; our $COMPAT_VALUE_ON = 1; our $COMPAT_VALUE_AUTO = 2; ! # Compatibility setting value names our %COMPAT_NAME_TO_VALUE = ( "off" => $COMPAT_VALUE_OFF, --- 89,98 ---- our $EXCL_LINE = "LCOV_EXCL_LINE"; ! # Compatibility mode values our $COMPAT_VALUE_OFF = 0; our $COMPAT_VALUE_ON = 1; our $COMPAT_VALUE_AUTO = 2; ! # Compatibility mode value names our %COMPAT_NAME_TO_VALUE = ( "off" => $COMPAT_VALUE_OFF, *************** *** 101,136 **** ); ! # Compatiblity setting flags ! our $COMPAT_FLAG_LIBTOOL = 1 << 0; ! our $COMPAT_FLAG_HAMMER = 1 << 1; ! our $COMPAT_FLAG_GCC_4_7 = 1 << 2; ! # Compatibility setting flag names ! our %COMPAT_NAME_TO_FLAG = ( ! "libtool" => $COMPAT_FLAG_LIBTOOL, ! "hammer" => $COMPAT_FLAG_HAMMER, ! "android_4_4_0" => $COMPAT_FLAG_GCC_4_7, ! "gcc_4_7" => $COMPAT_FLAG_GCC_4_7, ); ! # Map flags to names ! our %COMPAT_FLAG_TO_NAME = ( ! $COMPAT_FLAG_LIBTOOL => "libtool", ! $COMPAT_FLAG_HAMMER => "hammer", ! $COMPAT_FLAG_GCC_4_7 => "gcc_4_7/android_4_4_0", ); ! # Compatibility setting default values ! our %COMPAT_FLAG_DEFAULTS = ( ! $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, ! $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_FLAG_GCC_4_7 => $COMPAT_VALUE_AUTO, ); ! # Compatibility setting autodetection routines sub compat_hammer_autodetect(); ! our %COMPAT_FLAG_AUTO = ( ! $COMPAT_FLAG_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_FLAG_GCC_4_7 => 1, ); --- 101,136 ---- ); ! # Compatiblity modes ! our $COMPAT_MODE_LIBTOOL = 1 << 0; ! our $COMPAT_MODE_HAMMER = 1 << 1; ! our $COMPAT_MODE_GCC_4_7 = 1 << 2; ! # Compatibility mode names ! our %COMPAT_NAME_TO_MODE = ( ! "libtool" => $COMPAT_MODE_LIBTOOL, ! "hammer" => $COMPAT_MODE_HAMMER, ! "gcc_4_7" => $COMPAT_MODE_GCC_4_7, ! "android_4_4_0" => $COMPAT_MODE_GCC_4_7, ); ! # Map modes to names ! our %COMPAT_MODE_TO_NAME = ( ! $COMPAT_MODE_LIBTOOL => "libtool", ! $COMPAT_MODE_HAMMER => "hammer", ! $COMPAT_MODE_GCC_4_7 => "gcc_4_7", ); ! # Compatibility mode default values ! our %COMPAT_MODE_DEFAULTS = ( ! $COMPAT_MODE_LIBTOOL => $COMPAT_VALUE_ON, ! $COMPAT_MODE_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_MODE_GCC_4_7 => $COMPAT_VALUE_AUTO, ); ! # Compatibility mode auto-detection routines sub compat_hammer_autodetect(); ! our %COMPAT_MODE_AUTO = ( ! $COMPAT_MODE_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_MODE_GCC_4_7 => 1, # will be done later ); *************** *** 200,204 **** sub is_external($); sub compat_name($); ! sub parse_compat_flags($); sub is_compat($); sub is_compat_auto($); --- 200,204 ---- sub is_external($); sub compat_name($); ! sub parse_compat_modes($); sub is_compat($); sub is_compat_auto($); *************** *** 381,386 **** push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'}); ! # Determine compatibility flags ! parse_compat_flags($opt_compat); # Determine which errors the user wants us to ignore --- 381,386 ---- push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'}); ! # Determine compatibility modes ! parse_compat_modes($opt_compat); # Determine which errors the user wants us to ignore *************** *** 458,462 **** if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { $data_file_extension = ".da"; --- 458,462 ---- if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_MODE_HAMMER)) { $data_file_extension = ".da"; *************** *** 840,844 **** # avoid files from .libs dirs ! if (is_compat($COMPAT_FLAG_LIBTOOL) && $da_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { --- 840,844 ---- # avoid files from .libs dirs ! if (is_compat($COMPAT_MODE_LIBTOOL) && $da_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { *************** *** 898,902 **** if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { ($instr, $graph) = read_bbg($bb_filename, $base_dir); --- 898,902 ---- if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_MODE_HAMMER)) { ($instr, $graph) = read_bbg($bb_filename, $base_dir); *************** *** 2158,2162 **** # avoid files from .libs dirs ! if (is_compat($COMPAT_FLAG_LIBTOOL) && $graph_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { --- 2158,2162 ---- # avoid files from .libs dirs ! if (is_compat($COMPAT_MODE_LIBTOOL) && $graph_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { *************** *** 2176,2180 **** if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { ($instr, $graph) = read_bbg($graph_filename, $base_dir); --- 2176,2180 ---- if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_MODE_HAMMER)) { ($instr, $graph) = read_bbg($graph_filename, $base_dir); *************** *** 3052,3056 **** return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_FLAG_GCC_4_7)); # Heuristic: --- 3052,3056 ---- return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_MODE_GCC_4_7)); # Heuristic: *************** *** 3066,3070 **** $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if (!is_compat_auto($COMPAT_FLAG_GCC_4_7)) { # Sanity check if ($overlong_string) { --- 3066,3070 ---- $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if (!is_compat_auto($COMPAT_MODE_GCC_4_7)) { # Sanity check if ($overlong_string) { *************** *** 3326,3338 **** # ! # compat_name(flag) # ! # Return the name of compatibility flag FLAG. # sub compat_name($) { ! my ($flag) = @_; ! my $name = $COMPAT_FLAG_TO_NAME{$flag}; return $name if (defined($name)); --- 3326,3338 ---- # ! # compat_name(mode) # ! # Return the name of compatibility mode MODE. # sub compat_name($) { ! my ($mode) = @_; ! my $name = $COMPAT_MODE_TO_NAME{$mode}; return $name if (defined($name)); *************** *** 3342,3351 **** # ! # parse_compat_flags(opt) # ! # Determine compatibility flag settings. # ! sub parse_compat_flags($) { my ($opt) = @_; --- 3342,3351 ---- # ! # parse_compat_modes(opt) # ! # Determine compatibility mode settings. # ! sub parse_compat_modes($) { my ($opt) = @_; *************** *** 3354,3362 **** # Initialize with defaults ! %compat_value = %COMPAT_FLAG_DEFAULTS; # Add old style specifications if (defined($opt_compat_libtool)) { ! $compat_value{$COMPAT_FLAG_LIBTOOL} = $opt_compat_libtool ? $COMPAT_VALUE_ON : $COMPAT_VALUE_OFF; --- 3354,3362 ---- # Initialize with defaults ! %compat_value = %COMPAT_MODE_DEFAULTS; # Add old style specifications if (defined($opt_compat_libtool)) { ! $compat_value{$COMPAT_MODE_LIBTOOL} = $opt_compat_libtool ? $COMPAT_VALUE_ON : $COMPAT_VALUE_OFF; *************** *** 3368,3430 **** } foreach my $directive (@opt_list) { ! my ($flag, $value); # Either ! # flag=off|on|auto or ! # flag (implies auto) if ($directive !~ /^(\w+)=(\w+)$/ && $directive !~ /^(\w+)$/) { ! die("ERROR: Unknown compatibility setting format: ". "$directive!\n"); } ! # Determine flag ! $flag = $COMPAT_NAME_TO_FLAG{lc($1)}; ! if (!defined($flag)) { ! die("ERROR: Unknown compatibility setting: $1!\n"); } ! $specified{$flag} = 1; # Determine value if (defined($2)) { $value = $COMPAT_NAME_TO_VALUE{lc($2)}; if (!defined($value)) { ! die("ERROR: Unknown compatibility setting ". ! "value: $2!\n"); } } else { $value = $COMPAT_VALUE_ON; } ! $compat_value{$flag} = $value; } ! # Perform autodetection ! foreach my $flag (sort(keys(%compat_value))) { ! my $value = $compat_value{$flag}; my $is_autodetect = ""; ! my $name = compat_name($flag); if ($value == $COMPAT_VALUE_AUTO) { ! my $autodetect = $COMPAT_FLAG_AUTO{$flag}; if (!defined($autodetect)) { ! die("ERROR: No automatic detection for ". ! "setting '$name' available!\n"); } if (ref($autodetect) eq "CODE") { $value = &$autodetect(); ! $compat_value{$flag} = $value; $is_autodetect = " (auto-detected)"; } } ! if ($specified{$flag}) { if ($value == $COMPAT_VALUE_ON) { ! info("Enabling compatibility setting ". "'$name'$is_autodetect\n"); } elsif ($value == $COMPAT_VALUE_OFF) { ! info("Disabling compatibility setting ". "'$name'$is_autodetect\n"); } else { info("Using delayed auto-detection for ". ! "compatibility setting ". "'$name'\n"); } --- 3368,3430 ---- } foreach my $directive (@opt_list) { ! my ($mode, $value); # Either ! # mode=off|on|auto or ! # mode (implies on) if ($directive !~ /^(\w+)=(\w+)$/ && $directive !~ /^(\w+)$/) { ! die("ERROR: Unknown compatibility mode specification: ". "$directive!\n"); } ! # Determine mode ! $mode = $COMPAT_NAME_TO_MODE{lc($1)}; ! if (!defined($mode)) { ! die("ERROR: Unknown compatibility mode '$1'!\n"); } ! $specified{$mode} = 1; # Determine value if (defined($2)) { $value = $COMPAT_NAME_TO_VALUE{lc($2)}; if (!defined($value)) { ! die("ERROR: Unknown compatibility mode ". ! "value '$2'!\n"); } } else { $value = $COMPAT_VALUE_ON; } ! $compat_value{$mode} = $value; } ! # Perform auto-detection ! foreach my $mode (sort(keys(%compat_value))) { ! my $value = $compat_value{$mode}; my $is_autodetect = ""; ! my $name = compat_name($mode); if ($value == $COMPAT_VALUE_AUTO) { ! my $autodetect = $COMPAT_MODE_AUTO{$mode}; if (!defined($autodetect)) { ! die("ERROR: No auto-detection for ". ! "mode '$name' available!\n"); } if (ref($autodetect) eq "CODE") { $value = &$autodetect(); ! $compat_value{$mode} = $value; $is_autodetect = " (auto-detected)"; } } ! if ($specified{$mode}) { if ($value == $COMPAT_VALUE_ON) { ! info("Enabling compatibility mode ". "'$name'$is_autodetect\n"); } elsif ($value == $COMPAT_VALUE_OFF) { ! info("Disabling compatibility mode ". "'$name'$is_autodetect\n"); } else { info("Using delayed auto-detection for ". ! "compatibility mode ". "'$name'\n"); } *************** *** 3445,3472 **** # ! # is_compat(flag) # ! # Return non-zero if compatibility setting for FLAG is enabled. # sub is_compat($) { ! my ($flag) = @_; ! return 1 if ($compat_value{$flag} == $COMPAT_VALUE_ON); return 0; } # ! # is_compat_auto(flag) # ! # Return non-zero if compatibility setting for FLAG is set to auto-detect. # sub is_compat_auto($) { ! my ($flag) = @_; ! return 1 if ($compat_value{$flag} == $COMPAT_VALUE_AUTO); return 0; } --- 3445,3472 ---- # ! # is_compat(mode) # ! # Return non-zero if compatibility mode MODE is enabled. # sub is_compat($) { ! my ($mode) = @_; ! return 1 if ($compat_value{$mode} == $COMPAT_VALUE_ON); return 0; } # ! # is_compat_auto(mode) # ! # Return non-zero if compatibility mode MODE is set to auto-detect. # sub is_compat_auto($) { ! my ($mode) = @_; ! return 1 if ($compat_value{$mode} == $COMPAT_VALUE_AUTO); return 0; } |
From: Peter O. <obe...@us...> - 2012-07-06 09:03:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv11533 Modified Files: geninfo lcov Log Message: geninfo: improve detection of gcc 4.7 function records Suggestions by ga...@go...: - perform detection only once - add warning in case detection is off but overlong strings are found Misc: - add help text for --compat - isolate detection heuristic into separate function - rename corresponding compatibility setting to "gcc_4_7" - allow "android_4_4_0" as alias for "gcc_4_7" Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** geninfo 4 Jul 2012 16:06:10 -0000 1.98 --- geninfo 6 Jul 2012 09:03:27 -0000 1.99 *************** *** 104,108 **** our $COMPAT_FLAG_LIBTOOL = 1 << 0; our $COMPAT_FLAG_HAMMER = 1 << 1; ! our $COMPAT_FLAG_ANDROID_4_4_0 = 1 << 2; # Compatibility setting flag names --- 104,108 ---- our $COMPAT_FLAG_LIBTOOL = 1 << 0; our $COMPAT_FLAG_HAMMER = 1 << 1; ! our $COMPAT_FLAG_GCC_4_7 = 1 << 2; # Compatibility setting flag names *************** *** 110,114 **** "libtool" => $COMPAT_FLAG_LIBTOOL, "hammer" => $COMPAT_FLAG_HAMMER, ! "android_4_4_0" => $COMPAT_FLAG_ANDROID_4_4_0, ); --- 110,122 ---- "libtool" => $COMPAT_FLAG_LIBTOOL, "hammer" => $COMPAT_FLAG_HAMMER, ! "android_4_4_0" => $COMPAT_FLAG_GCC_4_7, ! "gcc_4_7" => $COMPAT_FLAG_GCC_4_7, ! ); ! ! # Map flags to names ! our %COMPAT_FLAG_TO_NAME = ( ! $COMPAT_FLAG_LIBTOOL => "libtool", ! $COMPAT_FLAG_HAMMER => "hammer", ! $COMPAT_FLAG_GCC_4_7 => "gcc_4_7/android_4_4_0", ); *************** *** 117,121 **** $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_FLAG_ANDROID_4_4_0 => $COMPAT_VALUE_AUTO, ); --- 125,129 ---- $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_FLAG_GCC_4_7 => $COMPAT_VALUE_AUTO, ); *************** *** 124,128 **** our %COMPAT_FLAG_AUTO = ( $COMPAT_FLAG_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_FLAG_ANDROID_4_4_0 => 1, ); --- 132,136 ---- our %COMPAT_FLAG_AUTO = ( $COMPAT_FLAG_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_FLAG_GCC_4_7 => 1, ); *************** *** 233,236 **** --- 241,245 ---- our $opt_compat; our %compat_value; + our $gcno_fmt_4_7; our $cwd = `pwd`; *************** *** 539,542 **** --- 548,552 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location + --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url *************** *** 3028,3031 **** --- 3038,3086 ---- # + # determine_gcno_fmt(handle, big_endian, rec_length) + # + # Determine if HANDLE refers to a .gcno file with a gcc 4.7 format function + # record. Return non-zero in case of gcc 4.7 format, zero otherwise, + # undef in case of read error. + # + + sub determine_gcno_fmt($$$) + { + my ($handle, $big_endian, $rec_length) = @_; + my $strlen; + my $overlong_string; + + return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); + return 1 if (is_compat($COMPAT_FLAG_GCC_4_7)); + + # Heuristic: + # Decide format based on contents of next word in record: + # - pre-gcc 4.7 + # This is the function name length / 4 which should be + # less than the remaining record length + # - gcc 4.7 + # This is a checksum, likely with high-order bits set, + # resulting in a large number + $strlen = read_gcno_value($handle, $big_endian, undef, 1); + return undef if (!defined($strlen)); + $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); + + if (!is_compat_auto($COMPAT_FLAG_GCC_4_7)) { + # Sanity check + if ($overlong_string) { + warn("Found overlong string in function record: ". + "try --compat gcc_4_7\n"); + } + return 0; + } elsif (!$overlong_string) { + return 0; + } + + info("Auto-detected compatibility mode for GCC 4.7\n"); + + return 1; + } + + # # read_gcno_function_record(handle, graph, base, big_endian, rec_length) # *************** *** 3041,3045 **** my $lineno; my $lines; - my $is_4_7; graph_expect("function record"); --- 3096,3099 ---- *************** *** 3047,3081 **** graph_skip($handle, 8, "function ident and checksum") or return undef; # Determine if this is a gcc 4.7 format function record ! if ($gcov_version >= $GCOV_VERSION_4_7_0) { ! $is_4_7 = 1; ! } elsif (is_compat($COMPAT_FLAG_ANDROID_4_4_0)) { ! $is_4_7 = 1; ! } elsif (is_compat_auto($COMPAT_FLAG_ANDROID_4_4_0)) { ! my $strlen = read_gcno_value($handle, $big_endian, undef, 1); ! ! return undef if (!defined($strlen)); ! ! # Heuristic: ! # - pre-gcc 4.7 ! # This is the function name length / 4 which should be ! # less than the remaining record length ! # - gcc 4.7 ! # This is a checksum, likely with high-order bits set, ! # resulting in a large number ! if ($strlen * 4 > $rec_length - 12) { ! if ($debug) { ! print(STDERR "DEBUG: found overlong string ". ! "length - assuming gcc 4.7 format\n"); ! } ! $is_4_7 = 1; ! } elsif ($debug) { ! print(STDERR "DEBUG: found strlen=".($strlen * 4). ! " and rec_length=".($rec_length - 12)."\n"); ! } } # Skip cfg checksum word in case of gcc 4.7 format function record ! if ($is_4_7) { ! graph_skip($handle, 4, "function cfg checksum"); ! } # Read function name graph_expect("function name"); --- 3101,3111 ---- graph_skip($handle, 8, "function ident and checksum") or return undef; # Determine if this is a gcc 4.7 format function record ! if (!defined($gcno_fmt_4_7)) { ! $gcno_fmt_4_7 = determine_gcno_fmt($handle, $big_endian, ! $rec_length); ! return undef if (!defined($gcno_fmt_4_7)); } # Skip cfg checksum word in case of gcc 4.7 format function record ! graph_skip($handle, 4, "function cfg checksum") if ($gcno_fmt_4_7); # Read function name graph_expect("function name"); *************** *** 3304,3311 **** { my ($flag) = @_; - foreach my $name (keys(%COMPAT_NAME_TO_FLAG)) { - return $name if ($COMPAT_NAME_TO_FLAG{$name} eq $flag); - } return "<unknown>"; } --- 3334,3341 ---- { my ($flag) = @_; + my $name = $COMPAT_FLAG_TO_NAME{$flag}; + + return $name if (defined($name)); return "<unknown>"; } Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** lcov 20 Jan 2012 11:53:57 -0000 1.81 --- lcov 6 Jul 2012 09:03:27 -0000 1.82 *************** *** 525,528 **** --- 525,529 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location + --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url |
From: Peter O. <obe...@us...> - 2012-07-04 16:06:12
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv25641 Modified Files: geninfo Log Message: geninfo: enable auto-detection of gcc-4.7 function record format gcc-4.7 introduced a modified function record format. This format is in use by android toolchains and has also been ported to some pre-4.7 versions of gcc. Introduce a heuristic-based auto-detection to correctly handle .gcno files in these cases. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** geninfo 8 Jun 2012 14:19:49 -0000 1.97 --- geninfo 4 Jul 2012 16:06:10 -0000 1.98 *************** *** 117,121 **** $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_FLAG_ANDROID_4_4_0 => $COMPAT_VALUE_OFF, ); --- 117,121 ---- $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_FLAG_ANDROID_4_4_0 => $COMPAT_VALUE_AUTO, ); *************** *** 124,127 **** --- 124,128 ---- our %COMPAT_FLAG_AUTO = ( $COMPAT_FLAG_HAMMER => \&compat_hammer_autodetect, + $COMPAT_FLAG_ANDROID_4_4_0 => 1, ); *************** *** 158,162 **** sub graph_error($$); sub graph_expect($); ! sub graph_read(*$;$); sub graph_skip(*$;$); sub sort_uniq(@); --- 159,163 ---- sub graph_error($$); sub graph_expect($); ! sub graph_read(*$;$$); sub graph_skip(*$;$); sub sort_uniq(@); *************** *** 175,183 **** sub read_bbg_lines_record(*$$$$$$); sub read_bbg($$); ! sub read_gcno_word(*;$); ! sub read_gcno_value(*$;$); sub read_gcno_string(*$); sub read_gcno_lines_record(*$$$$$$$); ! sub read_gcno_function_record(*$$$$); sub read_gcno($$); sub get_gcov_capabilities(); --- 176,184 ---- sub read_bbg_lines_record(*$$$$$$); sub read_bbg($$); ! sub read_gcno_word(*;$$); ! sub read_gcno_value(*$;$$); sub read_gcno_string(*$); sub read_gcno_lines_record(*$$$$$$$); ! sub read_gcno_function_record(*$$$$$); sub read_gcno($$); sub get_gcov_capabilities(); *************** *** 193,196 **** --- 194,198 ---- sub parse_compat_flags($); sub is_compat($); + sub is_compat_auto($); *************** *** 2316,2339 **** # ! # graph_read(handle, bytes[, description]) # # Read and return the specified number of bytes from handle. Return undef ! # if the number of bytes could not be read. # ! sub graph_read(*$;$) { ! my ($handle, $length, $desc) = @_; my $data; my $result; graph_expect($desc); $result = read($handle, $data, $length); if ($debug) { my $ascii = ""; my $hex = ""; my $i; ! print(STDERR "DEBUG: read($length)=$result: "); for ($i = 0; $i < length($data); $i++) { my $c = substr($data, $i, 1);; --- 2318,2351 ---- # ! # graph_read(handle, bytes[, description, peek]) # # Read and return the specified number of bytes from handle. Return undef ! # if the number of bytes could not be read. If PEEK is non-zero, reset ! # file position after read. # ! sub graph_read(*$;$$) { ! my ($handle, $length, $desc, $peek) = @_; my $data; my $result; + my $pos; graph_expect($desc); + if ($peek) { + $pos = tell($handle); + if ($pos == -1) { + warn("Could not get current file position: $!\n"); + return undef; + } + } $result = read($handle, $data, $length); if ($debug) { + my $op = $peek ? "peek" : "read"; my $ascii = ""; my $hex = ""; my $i; ! print(STDERR "DEBUG: $op($length)=$result: "); for ($i = 0; $i < length($data); $i++) { my $c = substr($data, $i, 1);; *************** *** 2350,2353 **** --- 2362,2371 ---- print(STDERR "\n"); } + if ($peek) { + if (!seek($handle, $pos, 0)) { + warn("Could not set file position: $!\n"); + return undef; + } + } if ($result != $length) { return undef; *************** *** 2900,2928 **** # ! # read_gcno_word(handle[, description]) # # Read and return a word in .gcno format. # ! sub read_gcno_word(*;$) { ! my ($handle, $desc) = @_; ! return graph_read($handle, 4, $desc); } # ! # read_gcno_value(handle, big_endian[, description]) # # Read a word in .gcno format from handle and return its integer value ! # according to the specified endianness. # ! sub read_gcno_value(*$;$) { ! my ($handle, $big_endian, $desc) = @_; my $word; ! $word = read_gcno_word($handle, $desc); return undef if (!defined($word)); if ($big_endian) { --- 2918,2948 ---- # ! # read_gcno_word(handle[, description, peek]) # # Read and return a word in .gcno format. # ! sub read_gcno_word(*;$$) { ! my ($handle, $desc, $peek) = @_; ! return graph_read($handle, 4, $desc, $peek); } # ! # read_gcno_value(handle, big_endian[, description, peek]) # # Read a word in .gcno format from handle and return its integer value ! # according to the specified endianness. If PEEK is non-zero, reset file ! # position after read. # ! sub read_gcno_value(*$;$$) { ! my ($handle, $big_endian, $desc, $peek) = @_; my $word; + my $pos; ! $word = read_gcno_word($handle, $desc, $peek); return undef if (!defined($word)); if ($big_endian) { *************** *** 3008,3012 **** # ! # read_gcno_function_record(handle, graph, base, big_endian) # # Read a gcno format function record from handle and add the relevant data --- 3028,3032 ---- # ! # read_gcno_function_record(handle, graph, base, big_endian, rec_length) # # Read a gcno format function record from handle and add the relevant data *************** *** 3014,3033 **** # ! sub read_gcno_function_record(*$$$$) { ! my ($handle, $bb, $fileorder, $base, $big_endian) = @_; my $filename; my $function; my $lineno; my $lines; graph_expect("function record"); # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! if (is_compat($COMPAT_FLAG_ANDROID_4_4_0) || ! ($gcov_version >= $GCOV_VERSION_4_7_0)) { ! # Skip extra checksum added by android 4.4.0 / gcc >= 4.7 ! # toolchains. ! graph_skip($handle, 4, "function extra checksum"); } # Read function name --- 3034,3080 ---- # ! sub read_gcno_function_record(*$$$$$) { ! my ($handle, $bb, $fileorder, $base, $big_endian, $rec_length) = @_; my $filename; my $function; my $lineno; my $lines; + my $is_4_7; graph_expect("function record"); # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! # Determine if this is a gcc 4.7 format function record ! if ($gcov_version >= $GCOV_VERSION_4_7_0) { ! $is_4_7 = 1; ! } elsif (is_compat($COMPAT_FLAG_ANDROID_4_4_0)) { ! $is_4_7 = 1; ! } elsif (is_compat_auto($COMPAT_FLAG_ANDROID_4_4_0)) { ! my $strlen = read_gcno_value($handle, $big_endian, undef, 1); ! ! return undef if (!defined($strlen)); ! ! # Heuristic: ! # - pre-gcc 4.7 ! # This is the function name length / 4 which should be ! # less than the remaining record length ! # - gcc 4.7 ! # This is a checksum, likely with high-order bits set, ! # resulting in a large number ! if ($strlen * 4 > $rec_length - 12) { ! if ($debug) { ! print(STDERR "DEBUG: found overlong string ". ! "length - assuming gcc 4.7 format\n"); ! } ! $is_4_7 = 1; ! } elsif ($debug) { ! print(STDERR "DEBUG: found strlen=".($strlen * 4). ! " and rec_length=".($rec_length - 12)."\n"); ! } ! } ! # Skip cfg checksum word in case of gcc 4.7 format function record ! if ($is_4_7) { ! graph_skip($handle, 4, "function cfg checksum"); } # Read function name *************** *** 3117,3121 **** if ($tag == $tag_function) { ($filename, $function) = read_gcno_function_record( ! *HANDLE, $bb, $fileorder, $base, $big_endian); goto incomplete if (!defined($function)); } elsif ($tag == $tag_lines) { --- 3164,3169 ---- if ($tag == $tag_function) { ($filename, $function) = read_gcno_function_record( ! *HANDLE, $bb, $fileorder, $base, $big_endian, ! $length); goto incomplete if (!defined($function)); } elsif ($tag == $tag_lines) { *************** *** 3331,3345 **** "setting '$name' available!\n"); } ! $value = &$autodetect(); ! $compat_value{$flag} = $value; ! $is_autodetect = " (autodetected)"; } if ($specified{$flag}) { if ($value == $COMPAT_VALUE_ON) { info("Enabling compatibility setting ". "'$name'$is_autodetect\n"); ! } else { info("Disabling compatibility setting ". "'$name'$is_autodetect\n"); } } --- 3379,3401 ---- "setting '$name' available!\n"); } ! ! if (ref($autodetect) eq "CODE") { ! $value = &$autodetect(); ! $compat_value{$flag} = $value; ! $is_autodetect = " (auto-detected)"; ! } } + if ($specified{$flag}) { if ($value == $COMPAT_VALUE_ON) { info("Enabling compatibility setting ". "'$name'$is_autodetect\n"); ! } elsif ($value == $COMPAT_VALUE_OFF) { info("Disabling compatibility setting ". "'$name'$is_autodetect\n"); + } else { + info("Using delayed auto-detection for ". + "compatibility setting ". + "'$name'\n"); } } *************** *** 3352,3356 **** $gcov_version_string =~ /mandrake/i && $gcov_version == 0x30302) { ! info("Autodetected compatibility mode for GCC 3.3 (hammer)\n"); return $COMPAT_VALUE_ON; } --- 3408,3412 ---- $gcov_version_string =~ /mandrake/i && $gcov_version == 0x30302) { ! info("Auto-detected compatibility mode for GCC 3.3 (hammer)\n"); return $COMPAT_VALUE_ON; } *************** *** 3371,3372 **** --- 3427,3442 ---- return 0; } + + # + # is_compat_auto(flag) + # + # Return non-zero if compatibility setting for FLAG is set to auto-detect. + # + + sub is_compat_auto($) + { + my ($flag) = @_; + + return 1 if ($compat_value{$flag} == $COMPAT_VALUE_AUTO); + return 0; + } |
From: Peter O. <obe...@us...> - 2012-06-08 14:19:52
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv20037/bin Modified Files: geninfo Log Message: geninfo: Make geninfo work more reliably on MSYS From: Martin Hopfeld <mar...@ss...> Using the lcov tools on Win7 with MSYS and MinGW 4.5.1/4.5.2 raised some issues for us: geninfo created in the for one source file in the 'SF:' line paths starting with a lowercase drive letter and sometimes starting with uppercase drive letters. This lead to inaccurate coverage results on the MSYS platform. This patch fixes this issue. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** geninfo 10 Apr 2012 11:48:52 -0000 1.96 --- geninfo 8 Jun 2012 14:19:49 -0000 1.97 *************** *** 1281,1285 **** # prepend volume, since in msys C: is always mounted to /c ! $volume =~ s|^([a-zA-Z]+):|/$1|; unshift( @dirs, $volume ); --- 1281,1285 ---- # prepend volume, since in msys C: is always mounted to /c ! $volume =~ s|^([a-zA-Z]+):|/\L$1\E|; unshift( @dirs, $volume ); |
From: Peter O. <obe...@us...> - 2012-05-07 16:04:51
|
Update of /cvsroot/ltp/utils/analysis/lcov/rpm In directory vz-cvs-4.sog:/tmp/cvs-serv13739 Modified Files: lcov.spec Log Message: lcov: add perl version dependency to RPM spec file lcov CVS (1.10 pre) seems to be broken on MSYS with perl 5.6.1. The issue is the following: genhtml: Unknown open() mode '>>&' at /usr/bin/genhtml line 5512. $> perl genhtml --version genhtml: LCOV version 1.10 pre (CVS 1.58) $> perl --version This is perl, v5.6.1 built for msys Fortunately perl v5.8.8 is available for MSYS and genhtml works like a charm with that 'new' version. Reported-by: Martin Hopfeld <mar...@ss...> Index: lcov.spec =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/rpm/lcov.spec,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** lcov.spec 6 Aug 2010 11:25:12 -0000 1.15 --- lcov.spec 7 May 2012 16:04:49 -0000 1.16 *************** *** 9,12 **** --- 9,13 ---- BuildRoot: /var/tmp/%{name}-%{version}-root BuildArch: noarch + Requires: perl >= 4:5.8.8 %description *************** *** 36,39 **** --- 37,42 ---- %changelog + * Mon May 07 2012 Peter Oberparleiter (Pet...@de...) + - added dependency on perl 5.8.8 for >>& open mode support * Wed Aug 13 2008 Peter Oberparleiter (Pet...@de...) - changed description + summary text |
From: Peter O. <obe...@us...> - 2012-04-10 11:48:54
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv24347/bin Modified Files: geninfo Log Message: geninfo: add support for gcc 4.7 .gcno file format Based on patch by ber...@re.... Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** geninfo 20 Jan 2012 11:53:57 -0000 1.95 --- geninfo 10 Apr 2012 11:48:52 -0000 1.96 *************** *** 67,70 **** --- 67,71 ---- our $tool_name = basename($0); + our $GCOV_VERSION_4_7_0 = 0x40700; our $GCOV_VERSION_3_4_0 = 0x30400; our $GCOV_VERSION_3_3_0 = 0x30300; *************** *** 3024,3030 **** # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! if (is_compat($COMPAT_FLAG_ANDROID_4_4_0)) { ! # Skip extra word added by android 4.4.0 toolchain. ! graph_skip($handle, 4, "android_4_4_0 extra word"); } # Read function name --- 3025,3033 ---- # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! if (is_compat($COMPAT_FLAG_ANDROID_4_4_0) || ! ($gcov_version >= $GCOV_VERSION_4_7_0)) { ! # Skip extra checksum added by android 4.4.0 / gcc >= 4.7 ! # toolchains. ! graph_skip($handle, 4, "function extra checksum"); } # Read function name |
From: Peter O. <obe...@us...> - 2012-01-20 11:54:00
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv12248 Modified Files: geninfo lcov Log Message: lcov: add new command line option --compat Add new option to lcov and geninfo to specify compatibility settings. Supported settings: libtool: same as --compat-libtool hammer: gcc3.3 hammer patch compatibility android_4_4_0: android toolchain 4_4_0 compatibility Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** geninfo 11 Aug 2011 08:29:21 -0000 1.94 --- geninfo 20 Jan 2012 11:53:57 -0000 1.95 *************** *** 74,79 **** our $BBG_FILE_MAGIC = 0x67626267; - our $COMPAT_HAMMER = "hammer"; - # Error classes which users may specify to ignore during processing our $ERROR_GCOV = 0; --- 74,77 ---- *************** *** 90,93 **** --- 88,128 ---- our $EXCL_LINE = "LCOV_EXCL_LINE"; + # Compatibility setting values + our $COMPAT_VALUE_OFF = 0; + our $COMPAT_VALUE_ON = 1; + our $COMPAT_VALUE_AUTO = 2; + + # Compatibility setting value names + our %COMPAT_NAME_TO_VALUE = ( + "off" => $COMPAT_VALUE_OFF, + "on" => $COMPAT_VALUE_ON, + "auto" => $COMPAT_VALUE_AUTO, + ); + + # Compatiblity setting flags + our $COMPAT_FLAG_LIBTOOL = 1 << 0; + our $COMPAT_FLAG_HAMMER = 1 << 1; + our $COMPAT_FLAG_ANDROID_4_4_0 = 1 << 2; + + # Compatibility setting flag names + our %COMPAT_NAME_TO_FLAG = ( + "libtool" => $COMPAT_FLAG_LIBTOOL, + "hammer" => $COMPAT_FLAG_HAMMER, + "android_4_4_0" => $COMPAT_FLAG_ANDROID_4_4_0, + ); + + # Compatibility setting default values + our %COMPAT_FLAG_DEFAULTS = ( + $COMPAT_FLAG_LIBTOOL => $COMPAT_VALUE_ON, + $COMPAT_FLAG_HAMMER => $COMPAT_VALUE_OFF, + $COMPAT_FLAG_ANDROID_4_4_0 => $COMPAT_VALUE_OFF, + ); + + # Compatibility setting autodetection routines + sub compat_hammer_autodetect(); + our %COMPAT_FLAG_AUTO = ( + $COMPAT_FLAG_HAMMER => \&compat_hammer_autodetect, + ); + our $BR_LINE = 0; our $BR_BLOCK = 1; *************** *** 154,161 **** --- 189,200 ---- sub parse_ignore_errors(@); sub is_external($); + sub compat_name($); + sub parse_compat_flags($); + sub is_compat($); # Global variables our $gcov_version; + our $gcov_version_string; our $graph_file_extension; our $data_file_extension; *************** *** 170,179 **** our $checksum; our $no_checksum; ! our $compat_libtool; ! our $no_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) --- 209,216 ---- our $checksum; our $no_checksum; ! our $opt_compat_libtool; ! our $opt_no_compat_libtool; our $adjust_testname; our $config; # Configuration file contents our @ignore_errors; # List of errors to ignore (parameter) our @ignore; # List of errors to ignore (array) *************** *** 191,194 **** --- 228,233 ---- our $opt_config_file; our $opt_gcov_all_blocks = 1; + our $opt_compat; + our %compat_value; our $cwd = `pwd`; *************** *** 236,242 **** "geninfo_checksum" => \$checksum, "geninfo_no_checksum" => \$no_checksum, # deprecated ! "geninfo_compat_libtool" => \$compat_libtool, "geninfo_external" => \$opt_external, "geninfo_gcov_all_blocks" => \$opt_gcov_all_blocks, }); --- 275,282 ---- "geninfo_checksum" => \$checksum, "geninfo_no_checksum" => \$no_checksum, # deprecated ! "geninfo_compat_libtool" => \$opt_compat_libtool, "geninfo_external" => \$opt_external, "geninfo_gcov_all_blocks" => \$opt_gcov_all_blocks, + "geninfo_compat" => \$opt_compat, }); *************** *** 259,264 **** "help|h|?" => \$help, "follow|f" => \$follow, ! "compat-libtool" => \$compat_libtool, ! "no-compat-libtool" => \$no_compat_libtool, "gcov-tool=s" => \$gcov_tool, "ignore-errors=s" => \@ignore_errors, --- 299,304 ---- "help|h|?" => \$help, "follow|f" => \$follow, ! "compat-libtool" => \$opt_compat_libtool, ! "no-compat-libtool" => \$opt_no_compat_libtool, "gcov-tool=s" => \$gcov_tool, "ignore-errors=s" => \@ignore_errors, *************** *** 270,273 **** --- 310,314 ---- "external" => \$opt_external, "no-external" => \$opt_no_external, + "compat=s" => \$opt_compat, )) { *************** *** 284,291 **** } ! if (defined($no_compat_libtool)) { ! $compat_libtool = ($no_compat_libtool ? 0 : 1); ! $no_compat_libtool = undef; } --- 325,332 ---- } ! if (defined($opt_no_compat_libtool)) { ! $opt_compat_libtool = ($opt_no_compat_libtool ? 0 : 1); ! $opt_no_compat_libtool = undef; } *************** *** 312,315 **** --- 353,375 ---- } + # Check gcov tool + if (system_no_output(3, $gcov_tool, "--help") == -1) + { + die("ERROR: need tool $gcov_tool!\n"); + } + + ($gcov_version, $gcov_version_string) = get_gcov_version(); + + # Determine gcov options + $gcov_caps = get_gcov_capabilities(); + push(@gcov_options, "-b") if ($gcov_caps->{'branch-probabilities'}); + push(@gcov_options, "-c") if ($gcov_caps->{'branch-counts'}); + push(@gcov_options, "-a") if ($gcov_caps->{'all-blocks'} && + $opt_gcov_all_blocks); + push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'}); + + # Determine compatibility flags + parse_compat_flags($opt_compat); + # Determine which errors the user wants us to ignore parse_ignore_errors(@ignore_errors); *************** *** 356,370 **** } - # Determine libtool compatibility mode - if (defined($compat_libtool)) - { - $compat_libtool = ($compat_libtool? 1 : 0); - } - else - { - # Default is on - $compat_libtool = 1; - } - # Determine max depth for recursion if ($no_recursion) --- 416,419 ---- *************** *** 395,408 **** } - if (system_no_output(3, $gcov_tool, "--help") == -1) - { - die("ERROR: need tool $gcov_tool!\n"); - } - - $gcov_version = get_gcov_version(); - if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (defined($compatibility) && $compatibility eq $COMPAT_HAMMER) { $data_file_extension = ".da"; --- 444,450 ---- } if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { $data_file_extension = ".da"; *************** *** 421,432 **** } - # Determine gcov options - $gcov_caps = get_gcov_capabilities(); - push(@gcov_options, "-b") if ($gcov_caps->{'branch-probabilities'}); - push(@gcov_options, "-c") if ($gcov_caps->{'branch-counts'}); - push(@gcov_options, "-a") if ($gcov_caps->{'all-blocks'} && - $opt_gcov_all_blocks); - push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'}); - # Check output filename if (defined($output_filename) && ($output_filename ne "-")) --- 463,466 ---- *************** *** 793,797 **** # avoid files from .libs dirs ! if ($compat_libtool && $da_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { --- 827,831 ---- # avoid files from .libs dirs ! if (is_compat($COMPAT_FLAG_LIBTOOL) && $da_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { *************** *** 851,855 **** if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (defined($compatibility) && $compatibility eq $COMPAT_HAMMER) { ($instr, $graph) = read_bbg($bb_filename, $base_dir); --- 885,889 ---- if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { ($instr, $graph) = read_bbg($bb_filename, $base_dir); *************** *** 1779,1789 **** } } ! if ($version_string =~ /suse/i && $result == 0x30303 || ! $version_string =~ /mandrake/i && $result == 0x30302) ! { ! info("Using compatibility mode for GCC 3.3 (hammer)\n"); ! $compatibility = $COMPAT_HAMMER; ! } ! return $result; } --- 1813,1817 ---- } } ! return ($result, $version_string); } *************** *** 2117,2121 **** # avoid files from .libs dirs ! if ($compat_libtool && $graph_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { --- 2145,2149 ---- # avoid files from .libs dirs ! if (is_compat($COMPAT_FLAG_LIBTOOL) && $graph_dir =~ m/(.*)\/\.libs$/) { $source_dir = $1; } else { *************** *** 2135,2139 **** if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (defined($compatibility) && $compatibility eq $COMPAT_HAMMER) { ($instr, $graph) = read_bbg($graph_filename, $base_dir); --- 2163,2167 ---- if ($gcov_version < $GCOV_VERSION_3_4_0) { ! if (is_compat($COMPAT_FLAG_HAMMER)) { ($instr, $graph) = read_bbg($graph_filename, $base_dir); *************** *** 2996,2999 **** --- 3024,3031 ---- # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; + if (is_compat($COMPAT_FLAG_ANDROID_4_4_0)) { + # Skip extra word added by android 4.4.0 toolchain. + graph_skip($handle, 4, "android_4_4_0 extra word"); + } # Read function name graph_expect("function name"); *************** *** 3211,3212 **** --- 3243,3369 ---- return 1; } + + # + # compat_name(flag) + # + # Return the name of compatibility flag FLAG. + # + + sub compat_name($) + { + my ($flag) = @_; + + foreach my $name (keys(%COMPAT_NAME_TO_FLAG)) { + return $name if ($COMPAT_NAME_TO_FLAG{$name} eq $flag); + } + return "<unknown>"; + } + + # + # parse_compat_flags(opt) + # + # Determine compatibility flag settings. + # + + sub parse_compat_flags($) + { + my ($opt) = @_; + my @opt_list; + my %specified; + + # Initialize with defaults + %compat_value = %COMPAT_FLAG_DEFAULTS; + + # Add old style specifications + if (defined($opt_compat_libtool)) { + $compat_value{$COMPAT_FLAG_LIBTOOL} = + $opt_compat_libtool ? $COMPAT_VALUE_ON + : $COMPAT_VALUE_OFF; + } + + # Parse settings + if (defined($opt)) { + @opt_list = split(/,/, $opt); + } + foreach my $directive (@opt_list) { + my ($flag, $value); + + # Either + # flag=off|on|auto or + # flag (implies auto) + if ($directive !~ /^(\w+)=(\w+)$/ && + $directive !~ /^(\w+)$/) { + die("ERROR: Unknown compatibility setting format: ". + "$directive!\n"); + } + # Determine flag + $flag = $COMPAT_NAME_TO_FLAG{lc($1)}; + if (!defined($flag)) { + die("ERROR: Unknown compatibility setting: $1!\n"); + } + $specified{$flag} = 1; + # Determine value + if (defined($2)) { + $value = $COMPAT_NAME_TO_VALUE{lc($2)}; + if (!defined($value)) { + die("ERROR: Unknown compatibility setting ". + "value: $2!\n"); + } + } else { + $value = $COMPAT_VALUE_ON; + } + $compat_value{$flag} = $value; + } + # Perform autodetection + foreach my $flag (sort(keys(%compat_value))) { + my $value = $compat_value{$flag}; + my $is_autodetect = ""; + my $name = compat_name($flag); + + if ($value == $COMPAT_VALUE_AUTO) { + my $autodetect = $COMPAT_FLAG_AUTO{$flag}; + + if (!defined($autodetect)) { + die("ERROR: No automatic detection for ". + "setting '$name' available!\n"); + } + $value = &$autodetect(); + $compat_value{$flag} = $value; + $is_autodetect = " (autodetected)"; + } + if ($specified{$flag}) { + if ($value == $COMPAT_VALUE_ON) { + info("Enabling compatibility setting ". + "'$name'$is_autodetect\n"); + } else { + info("Disabling compatibility setting ". + "'$name'$is_autodetect\n"); + } + } + } + } + + sub compat_hammer_autodetect() + { + if ($gcov_version_string =~ /suse/i && $gcov_version == 0x30303 || + $gcov_version_string =~ /mandrake/i && $gcov_version == 0x30302) + { + info("Autodetected compatibility mode for GCC 3.3 (hammer)\n"); + return $COMPAT_VALUE_ON; + } + return $COMPAT_VALUE_OFF; + } + + # + # is_compat(flag) + # + # Return non-zero if compatibility setting for FLAG is enabled. + # + + sub is_compat($) + { + my ($flag) = @_; + + return 1 if ($compat_value{$flag} == $COMPAT_VALUE_ON); + return 0; + } Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** lcov 19 Nov 2010 15:45:01 -0000 1.80 --- lcov 20 Jan 2012 11:53:57 -0000 1.81 *************** *** 192,195 **** --- 192,196 ---- our $opt_config_file; our @opt_summary; + our $opt_compat; our $ln_overall_found; our $ln_overall_hit; *************** *** 285,288 **** --- 286,290 ---- "no-external" => \$opt_no_external, "summary=s" => \@opt_summary, + "compat=s" => \$opt_compat, )) { *************** *** 859,862 **** --- 861,867 ---- @param = (@param, "--no-external"); } + if (defined($opt_compat)) { + @param = (@param, "--compat", $opt_compat); + } system(@param) and exit($? >> 8); } |
From: Peter O. <obe...@us...> - 2012-01-20 08:23:12
|
Update of /cvsroot/ltp/utils/analysis/gcov-kernel In directory vz-cvs-4.sog:/tmp/cvs-serv32403 Modified Files: linux-2.6.32-gcov-android-toolchain-4.4.0.patch Added Files: linux-3.2-gcov-android-toolchain-4.4.0.patch Log Message: gcov-kernel: fix broken gcov_persist mechanism for android There are changes in the data structures that need to be cloned by gcov-kernel when unloading/reloading modules while gcov_persist is on. Without these changes, attempts to access gcov data after module reload will fail. Fix this by implementing the correct gcov data clone function. --- NEW FILE: linux-3.2-gcov-android-toolchain-4.4.0.patch --- # # mk...@mo...: # This is motorola kernel team, we have found and fixed an issue in gcov # kernel patch when working with android toolchain 4.4.0. # # The new toolchain added new feature LIPO # http://gcc.gnu.org/wiki/LightweightIpo and Sampled FDO, David is the author # for thoes feature, those change are not in gcov kernel patch. With David # and peter's help, I updated gcov kernel patch, so that it could works with # new android toolchain. This patch should be useful for other android kernel # developers. # # Changes: # - 2012-01-20 Peter Oberparleiter <pet...@de...> # * fix gcov_persist mechanism # # kernel/gcov/gcc_3_4.c | 98 +++++++++++++++++++++++++++++++++++++++++--------- # kernel/gcov/gcov.h | 32 +++++++++++++++- # 2 files changed, 112 insertions(+), 18 deletions(-) # --- a/kernel/gcov/gcc_3_4.c +++ b/kernel/gcov/gcc_3_4.c @@ -146,6 +146,14 @@ struct gcov_info *gcov_info_dup(struct g get_fn_size(info), GFP_KERNEL); if (!dup->functions) goto err_free; + for (i = 0; i < info->n_functions; i++) { + struct gcov_fn_info *src_fn = get_fn_info(info, i); + struct gcov_fn_info *dst_fn = get_fn_info(dup, i); + + dst_fn->name = kstrdup(src_fn->name, GFP_KERNEL); + if (!dst_fn->name) + goto err_free; + } /* Duplicate counter arrays. */ for (i = 0; i < active ; i++) { struct gcov_ctr_info *ctr = &info->counts[i]; @@ -176,6 +184,8 @@ void gcov_info_free(struct gcov_info *in for (i = 0; i < active ; i++) vfree(info->counts[i].values); + for (i = 0; i < info->n_functions; i++) + kfree(get_fn_info(info, i)->name); kfree(info->functions); kfree(info->filename); kfree(info); @@ -297,16 +307,30 @@ void gcov_iter_start(struct gcov_iterato } /* Mapping of logical record number to actual file content. */ -#define RECORD_FILE_MAGIC 0 -#define RECORD_GCOV_VERSION 1 -#define RECORD_TIME_STAMP 2 -#define RECORD_FUNCTION_TAG 3 -#define RECORD_FUNCTON_TAG_LEN 4 -#define RECORD_FUNCTION_IDENT 5 -#define RECORD_FUNCTION_CHECK 6 -#define RECORD_COUNT_TAG 7 -#define RECORD_COUNT_LEN 8 -#define RECORD_COUNT 9 +#define RECORD_FILE_MAGIC 0 +#define RECORD_GCOV_VERSION 1 +#define RECORD_TIME_STAMP 2 +#define RECORD_FUNCTION_TAG 3 +#define RECORD_FUNCTON_TAG_LEN 4 +#define RECORD_FUNCTION_IDENT 5 +#define RECORD_FUNCTION_CHECK_LINE 6 +#define RECORD_FUNCTION_CHECK_CFG 7 +#define RECORD_FUNCTION_NAME_LEN 8 +#define RECORD_FUNCTION_NAME 9 +#define RECORD_COUNT_TAG 10 +#define RECORD_COUNT_LEN 11 +#define RECORD_COUNT 12 + +/* Return length of string encoded in GCOV format. */ +static size_t +sizeof_str(const char *str) +{ + size_t len; + len = (str) ? strlen(str) : 0; + if (len == 0) + return 1; + return 1 + ((len + 4) >> 2); +} /** * gcov_iter_next - advance file iterator to next logical record @@ -323,6 +347,9 @@ int gcov_iter_next(struct gcov_iterator case RECORD_FUNCTON_TAG_LEN: case RECORD_FUNCTION_IDENT: case RECORD_COUNT_TAG: + case RECORD_FUNCTION_CHECK_LINE: + case RECORD_FUNCTION_CHECK_CFG: + case RECORD_FUNCTION_NAME_LEN: /* Advance to next record */ iter->record++; break; @@ -332,7 +359,7 @@ int gcov_iter_next(struct gcov_iterator /* fall through */ case RECORD_COUNT_LEN: if (iter->count < get_func(iter)->n_ctrs[iter->type]) { - iter->record = 9; + iter->record = 12; break; } /* Advance to next counter type */ @@ -340,9 +367,9 @@ int gcov_iter_next(struct gcov_iterator iter->count = 0; iter->type++; /* fall through */ - case RECORD_FUNCTION_CHECK: + case RECORD_FUNCTION_NAME: if (iter->type < iter->num_types) { - iter->record = 7; + iter->record = 10; break; } /* Advance to next function */ @@ -395,6 +422,34 @@ static int seq_write_gcov_u64(struct seq data[1] = (v >> 32); return seq_write(seq, data, sizeof(data)); } +/** + * seq_write_gcov_str - write string in gcov format to seq_file + * @seq: seq_file handle + * @str: string to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. 64 bit numbers are stored as two 32 bit numbers, the low part + * first. + */ +static int seq_write_gcov_str(struct seq_file *seq, const char *str) +{ + if (str) { + size_t len; + int str_off; + u32 data; + len = strlen(str); + for (str_off = 0; str_off < (sizeof_str(str) - 2) ; str_off++) { + memcpy(&data, (str + str_off * 4), 4); + seq_write(seq, &data, sizeof(data)); + } + data = 0; + memcpy(&data, (str + str_off * 4), (len - str_off * 4)); + return seq_write(seq, &data, sizeof(data)); + } else { + return 0; + } +} /** * gcov_iter_write - write data for current pos to seq_file @@ -421,13 +476,24 @@ int gcov_iter_write(struct gcov_iterator rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION); break; case RECORD_FUNCTON_TAG_LEN: - rc = seq_write_gcov_u32(seq, 2); + rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION_LENGTH + + (sizeof_str(get_func(iter)->name))); break; case RECORD_FUNCTION_IDENT: rc = seq_write_gcov_u32(seq, get_func(iter)->ident); break; - case RECORD_FUNCTION_CHECK: - rc = seq_write_gcov_u32(seq, get_func(iter)->checksum); + case RECORD_FUNCTION_CHECK_LINE: + rc = seq_write_gcov_u32(seq, get_func(iter)->lineno_checksum); + break; + case RECORD_FUNCTION_CHECK_CFG: + rc = seq_write_gcov_u32(seq, get_func(iter)->cfg_checksum); + break; + case RECORD_FUNCTION_NAME_LEN: + rc = seq_write_gcov_u32(seq, + (sizeof_str(get_func(iter)->name) - 1)); + break; + case RECORD_FUNCTION_NAME: + rc = seq_write_gcov_str(seq, get_func(iter)->name); break; case RECORD_COUNT_TAG: rc = seq_write_gcov_u32(seq, --- a/kernel/gcov/gcov.h +++ b/kernel/gcov/gcov.h @@ -21,9 +21,10 @@ * gcc and need to be kept as close to the original definition as possible to * remain compatible. */ -#define GCOV_COUNTERS 5 +#define GCOV_COUNTERS 10 #define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) #define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) +#define GCOV_TAG_FUNCTION_LENGTH 3 #define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) #define GCOV_TAG_FOR_COUNTER(count) \ (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) @@ -34,6 +35,29 @@ typedef long gcov_type; typedef long long gcov_type; #endif +/* + * Source module info. The data structure is used in both runtime and + * profile-use phase. + */ +struct gcov_module_info { + unsigned int ident; +/* + * This is overloaded to mean two things: + * (1) means FDO/LIPO in instrumented binary. + * (2) means IS_PRIMARY in persistent file or memory copy used in profile-use. + */ + unsigned int is_primary; + unsigned int is_exported; + unsigned int lang; + char *da_filename; + char *source_filename; + unsigned int num_quote_paths; + unsigned int num_bracket_paths; + unsigned int num_cpp_defines; + char *string_array[1]; +}; + + /** * struct gcov_fn_info - profiling meta data per function * @ident: object file-unique function identifier @@ -45,7 +69,9 @@ typedef long long gcov_type; */ struct gcov_fn_info { unsigned int ident; - unsigned int checksum; + unsigned int lineno_checksum; + unsigned int cfg_checksum; /* function cfg checksum */ + const char *name; /* name of the function */ unsigned int n_ctrs[0]; }; @@ -80,9 +106,11 @@ struct gcov_ctr_info { */ struct gcov_info { unsigned int version; + struct gcov_module_info *mod_info; struct gcov_info *next; unsigned int stamp; const char *filename; + unsigned int eof_pos; unsigned int n_functions; const struct gcov_fn_info *functions; unsigned int ctr_mask; Index: linux-2.6.32-gcov-android-toolchain-4.4.0.patch =================================================================== RCS file: /cvsroot/ltp/utils/analysis/gcov-kernel/linux-2.6.32-gcov-android-toolchain-4.4.0.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** linux-2.6.32-gcov-android-toolchain-4.4.0.patch 22 Nov 2010 14:57:19 -0000 1.1 --- linux-2.6.32-gcov-android-toolchain-4.4.0.patch 20 Jan 2012 08:23:10 -0000 1.2 *************** *** 11,22 **** # developers. # ! # kernel/gcov/gcc_3_4.c | 88 ++++++++++++++++++++++++++++++++++-------- ! # kernel/gcov/gcov.h | 32 ++++++++++++++- ! # 2 files changed, 102 insertions(+), 18 deletions(-) # --- a/kernel/gcov/gcc_3_4.c +++ b/kernel/gcov/gcc_3_4.c ! @@ -297,16 +297,30 @@ void gcov_iter_start(struct gcov_iterato } --- 11,50 ---- # developers. # ! # Changes: ! # - 2012-01-20 Peter Oberparleiter <pet...@de...> ! # * fix gcov_persist mechanism ! # ! # kernel/gcov/gcc_3_4.c | 98 +++++++++++++++++++++++++++++++++++++++++--------- ! # kernel/gcov/gcov.h | 32 +++++++++++++++- ! # 2 files changed, 112 insertions(+), 18 deletions(-) # --- a/kernel/gcov/gcc_3_4.c +++ b/kernel/gcov/gcc_3_4.c ! @@ -146,6 +146,14 @@ struct gcov_info *gcov_info_dup(struct g ! get_fn_size(info), GFP_KERNEL); ! if (!dup->functions) ! goto err_free; ! + for (i = 0; i < info->n_functions; i++) { ! + struct gcov_fn_info *src_fn = get_fn_info(info, i); ! + struct gcov_fn_info *dst_fn = get_fn_info(dup, i); ! + ! + dst_fn->name = kstrdup(src_fn->name, GFP_KERNEL); ! + if (!dst_fn->name) ! + goto err_free; ! + } ! /* Duplicate counter arrays. */ ! for (i = 0; i < active ; i++) { ! struct gcov_ctr_info *ctr = &info->counts[i]; ! @@ -176,6 +184,8 @@ void gcov_info_free(struct gcov_info *in ! ! for (i = 0; i < active ; i++) ! vfree(info->counts[i].values); ! + for (i = 0; i < info->n_functions; i++) ! + kfree(get_fn_info(info, i)->name); ! kfree(info->functions); ! kfree(info->filename); ! kfree(info); ! @@ -297,16 +307,30 @@ void gcov_iter_start(struct gcov_iterato } *************** *** 59,63 **** /** * gcov_iter_next - advance file iterator to next logical record ! @@ -323,6 +337,9 @@ int gcov_iter_next(struct gcov_iterator case RECORD_FUNCTON_TAG_LEN: case RECORD_FUNCTION_IDENT: --- 87,91 ---- /** * gcov_iter_next - advance file iterator to next logical record ! @@ -323,6 +347,9 @@ int gcov_iter_next(struct gcov_iterator case RECORD_FUNCTON_TAG_LEN: case RECORD_FUNCTION_IDENT: *************** *** 69,73 **** iter->record++; break; ! @@ -332,7 +349,7 @@ int gcov_iter_next(struct gcov_iterator /* fall through */ case RECORD_COUNT_LEN: --- 97,101 ---- iter->record++; break; ! @@ -332,7 +359,7 @@ int gcov_iter_next(struct gcov_iterator /* fall through */ case RECORD_COUNT_LEN: *************** *** 78,82 **** } /* Advance to next counter type */ ! @@ -340,9 +357,9 @@ int gcov_iter_next(struct gcov_iterator iter->count = 0; iter->type++; --- 106,110 ---- } /* Advance to next counter type */ ! @@ -340,9 +367,9 @@ int gcov_iter_next(struct gcov_iterator iter->count = 0; iter->type++; *************** *** 90,94 **** } /* Advance to next function */ ! @@ -395,6 +412,34 @@ static int seq_write_gcov_u64(struct seq data[1] = (v >> 32); return seq_write(seq, data, sizeof(data)); --- 118,122 ---- } /* Advance to next function */ ! @@ -395,6 +422,34 @@ static int seq_write_gcov_u64(struct seq data[1] = (v >> 32); return seq_write(seq, data, sizeof(data)); *************** *** 125,129 **** /** * gcov_iter_write - write data for current pos to seq_file ! @@ -421,13 +466,24 @@ int gcov_iter_write(struct gcov_iterator rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION); break; --- 153,157 ---- /** * gcov_iter_write - write data for current pos to seq_file ! @@ -421,13 +476,24 @@ int gcov_iter_write(struct gcov_iterator rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION); break; |
From: Peter O. <obe...@us...> - 2011-05-23 08:03:19
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-2.sog:/tmp/cvs-serv16248/bin Modified Files: geninfo Log Message: geninfo: Make geninfo handle MinGW output on MSYS. From: Martin Hopfeld <mar...@ss...> This patch converts path mixtures from MinGW when running on MSYS to correct MSYS paths. In solve_relative_path() an additional conversion step will be inserted when running on MSYS. This will extract the drive letter and convert the remaining path from Windows pathnames to Unix Paths, which are used by MSYS. Additionally, if no drive letter is found, the (relative) path is converted to Unix style. There may be the case where Windows and Unix path separators are intermixed within one path string. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** geninfo 19 Nov 2010 16:15:27 -0000 1.92 --- geninfo 23 May 2011 08:03:13 -0000 1.93 *************** *** 56,60 **** use Getopt::Long; use Digest::MD5 qw(md5_base64); ! # Constants --- 56,63 ---- use Getopt::Long; use Digest::MD5 qw(md5_base64); ! if( $^O eq "msys" ) ! { ! require File::Spec::Win32; ! } # Constants *************** *** 1221,1226 **** --- 1224,1261 ---- my $path = $_[0]; my $dir = $_[1]; + my $volume; + my $directories; + my $filename; + my @dirs; # holds path elements my $result; + # Convert from Windows path to msys path + if( $^O eq "msys" ) + { + # search for a windows drive letter at the beginning + ($volume, $directories, $filename) = File::Spec::Win32->splitpath( $dir ); + if( $volume ne '' ) + { + my $uppercase_volume; + # transform c/d\../e/f\g to Windows style c\d\..\e\f\g + $dir = File::Spec::Win32->canonpath( $dir ); + # use Win32 module to retrieve path components + # $uppercase_volume is not used any further + ( $uppercase_volume, $directories, $filename ) = File::Spec::Win32->splitpath( $dir ); + @dirs = File::Spec::Win32->splitdir( $directories ); + + # prepend volume, since in msys C: is always mounted to /c + $volume =~ s|^([a-zA-Z]+):|/$1|; + unshift( @dirs, $volume ); + + # transform to Unix style '/' path + $directories = File::Spec->catdir( @dirs ); + $dir = File::Spec->catpath( '', $directories, $filename ); + } else { + # eliminate '\' path separators + $dir = File::Spec->canonpath( $dir ); + } + } + $result = $dir; # Prepend path if not absolute |
From: Peter O. <obe...@us...> - 2010-12-16 08:11:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6305 Modified Files: genpng Log Message: genpng: handle empty source files Generating an overview PNG image for an empty source code file fails. Handle this case by assuming a single empty line when run for an empty source code file. Reported by: syl...@de... Index: genpng =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genpng,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** genpng 19 Nov 2010 15:45:01 -0000 1.17 --- genpng 16 Dec 2010 08:11:22 -0000 1.18 *************** *** 239,243 **** my $tab_size = shift(@_); # Replacement string for tab signs my @source = @_; # Source code as passed via argument 2 ! my $height = scalar(@source); # Height as define by source size my $overview; # Source code overview image data my $col_plain_back; # Color for overview background --- 239,243 ---- my $tab_size = shift(@_); # Replacement string for tab signs my @source = @_; # Source code as passed via argument 2 ! my $height; # Height as define by source size my $overview; # Source code overview image data my $col_plain_back; # Color for overview background *************** *** 262,265 **** --- 262,270 ---- local *PNG_HANDLE; # Handle for output PNG file + # Handle empty source files + if (!@source) { + @source = ( "" ); + } + $height = scalar(@source); # Create image $overview = new GD::Image($overview_width, $height) |
From: Peter O. <obe...@us...> - 2010-12-07 08:40:17
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8336 Modified Files: genhtml.1 Log Message: genhtml: add note to further explain branch coverage output Index: genhtml.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/genhtml.1,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** genhtml.1 7 Dec 2010 08:29:45 -0000 1.23 --- genhtml.1 7 Dec 2010 08:40:09 -0000 1.24 *************** *** 471,474 **** --- 471,478 ---- .br + Note that it might not always be possible to relate branches to the + corresponding source code statements: during compilation, GCC might shuffle + branches around or eliminate some of them to generate better code. + This option can also be configured permanently using the configuration file option |
From: Peter O. <obe...@us...> - 2010-12-07 08:29:54
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5696 Modified Files: genhtml.1 Log Message: genhtml: fixed incorrect description of default coverage rates Index: genhtml.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/genhtml.1,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** genhtml.1 24 Aug 2010 16:15:53 -0000 1.22 --- genhtml.1 7 Dec 2010 08:29:45 -0000 1.23 *************** *** 86,90 **** marked in different colors depending on the associated coverage rate. By default, the coverage limits for low, medium and high coverage are set to ! 0\-15%, 15\-50% and 50\-100% percent respectively. To change these values, use configuration file options .IR genhtml_hi_limit " and " genhtml_med_limit . --- 86,90 ---- marked in different colors depending on the associated coverage rate. By default, the coverage limits for low, medium and high coverage are set to ! 0\-75%, 75\-90% and 90\-100% percent respectively. To change these values, use configuration file options .IR genhtml_hi_limit " and " genhtml_med_limit . |
From: Peter O. <obe...@us...> - 2010-11-22 14:57:27
|
Update of /cvsroot/ltp/utils/analysis/gcov-kernel In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7977 Added Files: linux-2.6.32-gcov-android-toolchain-4.4.0.patch Log Message: gcov-kernel: add-on patch for android toolchain 4.4.0 support --- NEW FILE: linux-2.6.32-gcov-android-toolchain-4.4.0.patch --- # # mk...@mo...: # This is motorola kernel team, we have found and fixed an issue in gcov # kernel patch when working with android toolchain 4.4.0. # # The new toolchain added new feature LIPO # http://gcc.gnu.org/wiki/LightweightIpo and Sampled FDO, David is the author # for thoes feature, those change are not in gcov kernel patch. With David # and peter's help, I updated gcov kernel patch, so that it could works with # new android toolchain. This patch should be useful for other android kernel # developers. # # kernel/gcov/gcc_3_4.c | 88 ++++++++++++++++++++++++++++++++++-------- # kernel/gcov/gcov.h | 32 ++++++++++++++- # 2 files changed, 102 insertions(+), 18 deletions(-) # --- a/kernel/gcov/gcc_3_4.c +++ b/kernel/gcov/gcc_3_4.c @@ -297,16 +297,30 @@ void gcov_iter_start(struct gcov_iterato } /* Mapping of logical record number to actual file content. */ -#define RECORD_FILE_MAGIC 0 -#define RECORD_GCOV_VERSION 1 -#define RECORD_TIME_STAMP 2 -#define RECORD_FUNCTION_TAG 3 -#define RECORD_FUNCTON_TAG_LEN 4 -#define RECORD_FUNCTION_IDENT 5 -#define RECORD_FUNCTION_CHECK 6 -#define RECORD_COUNT_TAG 7 -#define RECORD_COUNT_LEN 8 -#define RECORD_COUNT 9 +#define RECORD_FILE_MAGIC 0 +#define RECORD_GCOV_VERSION 1 +#define RECORD_TIME_STAMP 2 +#define RECORD_FUNCTION_TAG 3 +#define RECORD_FUNCTON_TAG_LEN 4 +#define RECORD_FUNCTION_IDENT 5 +#define RECORD_FUNCTION_CHECK_LINE 6 +#define RECORD_FUNCTION_CHECK_CFG 7 +#define RECORD_FUNCTION_NAME_LEN 8 +#define RECORD_FUNCTION_NAME 9 +#define RECORD_COUNT_TAG 10 +#define RECORD_COUNT_LEN 11 +#define RECORD_COUNT 12 + +/* Return length of string encoded in GCOV format. */ +static size_t +sizeof_str(const char *str) +{ + size_t len; + len = (str) ? strlen(str) : 0; + if (len == 0) + return 1; + return 1 + ((len + 4) >> 2); +} /** * gcov_iter_next - advance file iterator to next logical record @@ -323,6 +337,9 @@ int gcov_iter_next(struct gcov_iterator case RECORD_FUNCTON_TAG_LEN: case RECORD_FUNCTION_IDENT: case RECORD_COUNT_TAG: + case RECORD_FUNCTION_CHECK_LINE: + case RECORD_FUNCTION_CHECK_CFG: + case RECORD_FUNCTION_NAME_LEN: /* Advance to next record */ iter->record++; break; @@ -332,7 +349,7 @@ int gcov_iter_next(struct gcov_iterator /* fall through */ case RECORD_COUNT_LEN: if (iter->count < get_func(iter)->n_ctrs[iter->type]) { - iter->record = 9; + iter->record = 12; break; } /* Advance to next counter type */ @@ -340,9 +357,9 @@ int gcov_iter_next(struct gcov_iterator iter->count = 0; iter->type++; /* fall through */ - case RECORD_FUNCTION_CHECK: + case RECORD_FUNCTION_NAME: if (iter->type < iter->num_types) { - iter->record = 7; + iter->record = 10; break; } /* Advance to next function */ @@ -395,6 +412,34 @@ static int seq_write_gcov_u64(struct seq data[1] = (v >> 32); return seq_write(seq, data, sizeof(data)); } +/** + * seq_write_gcov_str - write string in gcov format to seq_file + * @seq: seq_file handle + * @str: string to be stored + * + * Number format defined by gcc: numbers are recorded in the 32 bit + * unsigned binary form of the endianness of the machine generating the + * file. 64 bit numbers are stored as two 32 bit numbers, the low part + * first. + */ +static int seq_write_gcov_str(struct seq_file *seq, const char *str) +{ + if (str) { + size_t len; + int str_off; + u32 data; + len = strlen(str); + for (str_off = 0; str_off < (sizeof_str(str) - 2) ; str_off++) { + memcpy(&data, (str + str_off * 4), 4); + seq_write(seq, &data, sizeof(data)); + } + data = 0; + memcpy(&data, (str + str_off * 4), (len - str_off * 4)); + return seq_write(seq, &data, sizeof(data)); + } else { + return 0; + } +} /** * gcov_iter_write - write data for current pos to seq_file @@ -421,13 +466,24 @@ int gcov_iter_write(struct gcov_iterator rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION); break; case RECORD_FUNCTON_TAG_LEN: - rc = seq_write_gcov_u32(seq, 2); + rc = seq_write_gcov_u32(seq, GCOV_TAG_FUNCTION_LENGTH + + (sizeof_str(get_func(iter)->name))); break; case RECORD_FUNCTION_IDENT: rc = seq_write_gcov_u32(seq, get_func(iter)->ident); break; - case RECORD_FUNCTION_CHECK: - rc = seq_write_gcov_u32(seq, get_func(iter)->checksum); + case RECORD_FUNCTION_CHECK_LINE: + rc = seq_write_gcov_u32(seq, get_func(iter)->lineno_checksum); + break; + case RECORD_FUNCTION_CHECK_CFG: + rc = seq_write_gcov_u32(seq, get_func(iter)->cfg_checksum); + break; + case RECORD_FUNCTION_NAME_LEN: + rc = seq_write_gcov_u32(seq, + (sizeof_str(get_func(iter)->name) - 1)); + break; + case RECORD_FUNCTION_NAME: + rc = seq_write_gcov_str(seq, get_func(iter)->name); break; case RECORD_COUNT_TAG: rc = seq_write_gcov_u32(seq, --- a/kernel/gcov/gcov.h +++ b/kernel/gcov/gcov.h @@ -21,9 +21,10 @@ * gcc and need to be kept as close to the original definition as possible to * remain compatible. */ -#define GCOV_COUNTERS 5 +#define GCOV_COUNTERS 10 #define GCOV_DATA_MAGIC ((unsigned int) 0x67636461) #define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000) +#define GCOV_TAG_FUNCTION_LENGTH 3 #define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000) #define GCOV_TAG_FOR_COUNTER(count) \ (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17)) @@ -34,6 +35,29 @@ typedef long gcov_type; typedef long long gcov_type; #endif +/* + * Source module info. The data structure is used in both runtime and + * profile-use phase. + */ +struct gcov_module_info { + unsigned int ident; +/* + * This is overloaded to mean two things: + * (1) means FDO/LIPO in instrumented binary. + * (2) means IS_PRIMARY in persistent file or memory copy used in profile-use. + */ + unsigned int is_primary; + unsigned int is_exported; + unsigned int lang; + char *da_filename; + char *source_filename; + unsigned int num_quote_paths; + unsigned int num_bracket_paths; + unsigned int num_cpp_defines; + char *string_array[1]; +}; + + /** * struct gcov_fn_info - profiling meta data per function * @ident: object file-unique function identifier @@ -45,7 +69,9 @@ typedef long long gcov_type; */ struct gcov_fn_info { unsigned int ident; - unsigned int checksum; + unsigned int lineno_checksum; + unsigned int cfg_checksum; /* function cfg checksum */ + const char *name; /* name of the function */ unsigned int n_ctrs[0]; }; @@ -80,9 +106,11 @@ struct gcov_ctr_info { */ struct gcov_info { unsigned int version; + struct gcov_module_info *mod_info; struct gcov_info *next; unsigned int stamp; const char *filename; + unsigned int eof_pos; unsigned int n_functions; const struct gcov_fn_info *functions; unsigned int ctr_mask; |
From: Peter O. <obe...@us...> - 2010-11-19 16:33:33
|
Update of /cvsroot/ltp/utils/analysis/lcov/man In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8760/man Modified Files: geninfo.1 Log Message: geninfo: add missing man page sections Add sections describing options --derive-func-data and --no-markers to the geninfo man page. Index: geninfo.1 =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/man/geninfo.1,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** geninfo.1 24 Aug 2010 16:15:53 -0000 1.19 --- geninfo.1 19 Nov 2010 16:33:25 -0000 1.20 *************** *** 38,41 **** --- 38,44 ---- .RB [ \-\-config\-file .IR config\-file ] + .RB [ \-\-no\-markers ] + .br + .RB [ \-\-derive\-func\-data ] .RE .SH DESCRIPTION *************** *** 180,183 **** --- 183,197 ---- .RE + .B \-\-derive\-func\-data + .br + .RS + Calculate function coverage data from line coverage data. + + Use this option to collect function coverage data, even if the version of the + gcov tool installed on the test system does not provide this data. lcov will + instead derive function coverage data from line coverage data and + information about which lines belong to a function. + .RE + .B \-\-external .br *************** *** 254,257 **** --- 268,278 ---- .RE + .B \-\-no\-markers + .br + .RS + Use this option if you want to get coverage data without regard to exclusion + markers in the source code file. + .RE + .B \-\-no\-recursion .br |
From: Peter O. <obe...@us...> - 2010-11-19 16:15:35
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4414 Modified Files: geninfo Log Message: geninfo: remove help text for unimplemented parameter Parameter --function-coverage was removed but the help text still mentions it. Fix this by removing the option from the help text as well. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** geninfo 19 Nov 2010 15:45:01 -0000 1.91 --- geninfo 19 Nov 2010 16:15:27 -0000 1.92 *************** *** 495,499 **** --ignore-errors ERROR Continue after ERROR (gcov, source, graph) --no-recursion Exclude subdirectories from processing - --function-coverage Capture function call counts --no-markers Ignore exclusion markers in source code --derive-func-data Generate function data from line data --- 495,498 ---- |
From: Peter O. <obe...@us...> - 2010-11-19 16:00:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1390 Modified Files: genhtml Log Message: genhtml: handle special characters in file and directory names HTML special characters (e.g. '<') found in file or directory names are not correctly shown in HTML output. Fix this by correctly escaping such characters. Index: genhtml =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genhtml,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** genhtml 19 Nov 2010 15:45:01 -0000 1.57 --- genhtml 19 Nov 2010 16:00:22 -0000 1.58 *************** *** 3442,3451 **** my $file_code; my $entry; # Add link to source if provided if (defined($page_link) && $page_link ne "") { ! $file_code = "<a href=\"$page_link\">$filename</a>"; } else { ! $file_code = $filename; } --- 3442,3452 ---- my $file_code; my $entry; + my $esc_filename = escape_html($filename); # Add link to source if provided if (defined($page_link) && $page_link ne "") { ! $file_code = "<a href=\"$page_link\">$esc_filename</a>"; } else { ! $file_code = $esc_filename; } *************** *** 4199,4202 **** --- 4200,4204 ---- my $num_rows; my $i; + my $esc_trunc_name = escape_html($trunc_name); $base_name = basename($rel_filename); *************** *** 4214,4218 **** $base_dir = get_relative_base_path($rel_filename); $view = "<a href=\"$base_dir"."index.$html_ext\">". ! "$overview_title</a> - $trunc_name"; } elsif ($type == $HDR_SOURCE || $type == $HDR_FUNC) --- 4216,4220 ---- $base_dir = get_relative_base_path($rel_filename); $view = "<a href=\"$base_dir"."index.$html_ext\">". ! "$overview_title</a> - $esc_trunc_name"; } elsif ($type == $HDR_SOURCE || $type == $HDR_FUNC) *************** *** 4220,4223 **** --- 4222,4227 ---- # File view my $dir_name = dirname($rel_filename); + my $esc_base_name = escape_html($base_name); + my $esc_dir_name = escape_html($dir_name); $base_dir = get_relative_base_path($dir_name); *************** *** 4229,4233 **** "target=\"_parent\">$overview_title</a> - ". "<a href=\"index.$html_ext\" target=\"_parent\">". ! "$dir_name</a> - $base_name"; } else --- 4233,4237 ---- "target=\"_parent\">$overview_title</a> - ". "<a href=\"index.$html_ext\" target=\"_parent\">". ! "$esc_dir_name</a> - $esc_base_name"; } else *************** *** 4236,4240 **** "$overview_title</a> - ". "<a href=\"index.$html_ext\">". ! "$dir_name</a> - $base_name"; } --- 4240,4244 ---- "$overview_title</a> - ". "<a href=\"index.$html_ext\">". ! "$esc_dir_name</a> - $esc_base_name"; } |
From: Peter O. <obe...@us...> - 2010-11-19 15:45:10
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30945 Modified Files: gendesc genhtml geninfo genpng lcov Log Message: gendesc/genhtml/geninfo/genpng/lcov: handle '<' in filenames Use 3-arg open mode to prevent that a special character (e.g. '<') found in a user-specified filename interfers with the required open mode for that file. Index: genpng =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genpng,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** genpng 20 Aug 2010 13:14:50 -0000 1.16 --- genpng 19 Nov 2010 15:45:01 -0000 1.17 *************** *** 183,187 **** my @source; ! open(HANDLE, "<$filename") or die("ERROR: cannot open $filename!\n"); --- 183,187 ---- my @source; ! open(HANDLE, "<", $filename) or die("ERROR: cannot open $filename!\n"); *************** *** 363,367 **** # Write PNG file ! open (PNG_HANDLE, ">$filename") or die("ERROR: cannot write png file $filename!\n"); binmode(*PNG_HANDLE); --- 363,367 ---- # Write PNG file ! open (PNG_HANDLE, ">", $filename) or die("ERROR: cannot write png file $filename!\n"); binmode(*PNG_HANDLE); Index: genhtml =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/genhtml,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** genhtml 24 Aug 2010 16:15:53 -0000 1.56 --- genhtml 19 Nov 2010 15:45:01 -0000 1.57 *************** *** 858,862 **** if ($html_gzip) { ! open($handle, "|gzip -c >$filename") or die("ERROR: cannot open $filename for writing ". "(gzip)!\n"); --- 858,862 ---- if ($html_gzip) { ! open($handle, "|-", "gzip -c >'$filename'") or die("ERROR: cannot open $filename for writing ". "(gzip)!\n"); *************** *** 864,868 **** else { ! open($handle, ">$filename") or die("ERROR: cannot open $filename for writing!\n"); } --- 864,868 ---- else { ! open($handle, ">", $filename) or die("ERROR: cannot open $filename for writing!\n"); } *************** *** 1308,1312 **** # Open compressed file ! open(INFO_HANDLE, "gunzip -c $_[0]|") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); --- 1308,1312 ---- # Open compressed file ! open(INFO_HANDLE, "-|", "gunzip -c '$_[0]'") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); *************** *** 1315,1319 **** { # Open decompressed file ! open(INFO_HANDLE, $_[0]) or die("ERROR: cannot read file $_[0]!\n"); } --- 1315,1319 ---- { # Open decompressed file ! open(INFO_HANDLE, "<", $_[0]) or die("ERROR: cannot read file $_[0]!\n"); } *************** *** 2287,2291 **** local *TEST_HANDLE; ! open(TEST_HANDLE, "<".$_[0]) or die("ERROR: cannot open $_[0]!\n"); --- 2287,2291 ---- local *TEST_HANDLE; ! open(TEST_HANDLE, "<", $_[0]) or die("ERROR: cannot open $_[0]!\n"); *************** *** 2558,2562 **** foreach (keys(%data)) { ! open(PNG_HANDLE, ">".$_) or die("ERROR: cannot create $_!\n"); binmode(PNG_HANDLE); --- 2558,2562 ---- foreach (keys(%data)) { ! open(PNG_HANDLE, ">", $_) or die("ERROR: cannot create $_!\n"); binmode(PNG_HANDLE); *************** *** 2576,2580 **** my $htaccess_data; ! open(*HTACCESS_HANDLE, ">.htaccess") or die("ERROR: cannot open .htaccess for writing!\n"); --- 2576,2580 ---- my $htaccess_data; ! open(*HTACCESS_HANDLE, ">", ".htaccess") or die("ERROR: cannot open .htaccess for writing!\n"); *************** *** 2609,2613 **** } ! open(CSS_HANDLE, ">gcov.css") or die ("ERROR: cannot open gcov.css for writing!\n"); --- 2609,2613 ---- } ! open(CSS_HANDLE, ">", "gcov.css") or die ("ERROR: cannot open gcov.css for writing!\n"); *************** *** 4992,4996 **** } ! if (!open(SOURCE_HANDLE, "<".$source_filename)) { my @lines; my $last_line = 0; --- 4992,4996 ---- } ! if (!open(SOURCE_HANDLE, "<", $source_filename)) { my @lines; my $last_line = 0; *************** *** 5506,5515 **** # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">/dev/null"); ! ($mode & 2) && open(STDERR, ">/dev/null"); system(@_); --- 5506,5515 ---- # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&", "STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&", "STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">", "/dev/null"); ! ($mode & 2) && open(STDERR, ">", "/dev/null"); system(@_); *************** *** 5521,5526 **** # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&OLD_STDERR"); return $result; --- 5521,5526 ---- # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&", "OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&", "OLD_STDERR"); return $result; *************** *** 5543,5547 **** local *HANDLE; ! if (!open(HANDLE, "<$filename")) { warn("WARNING: cannot read configuration file $filename\n"); --- 5543,5547 ---- local *HANDLE; ! if (!open(HANDLE, "<", $filename)) { warn("WARNING: cannot read configuration file $filename\n"); *************** *** 5616,5620 **** local *HANDLE; ! open(HANDLE, "<".$filename) or die("ERROR: cannot open html prolog $filename!\n"); while (<HANDLE>) --- 5616,5620 ---- local *HANDLE; ! open(HANDLE, "<", $filename) or die("ERROR: cannot open html prolog $filename!\n"); while (<HANDLE>) *************** *** 5662,5666 **** local *HANDLE; ! open(HANDLE, "<".$filename) or die("ERROR: cannot open html epilog $filename!\n"); while (<HANDLE>) --- 5662,5666 ---- local *HANDLE; ! open(HANDLE, "<", $filename) or die("ERROR: cannot open html epilog $filename!\n"); while (<HANDLE>) Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** lcov 24 Aug 2010 16:15:53 -0000 1.79 --- lcov 19 Nov 2010 15:45:01 -0000 1.80 *************** *** 644,648 **** die("ERROR: no reset control found in $gcov_dir\n"); } ! open(HANDLE, ">$reset_file") or die("ERROR: cannot write to $reset_file!\n"); print(HANDLE "0"); --- 644,648 ---- die("ERROR: no reset control found in $gcov_dir\n"); } ! open(HANDLE, ">", $reset_file) or die("ERROR: cannot write to $reset_file!\n"); print(HANDLE "0"); *************** *** 666,673 **** local *HANDLE; ! open(HANDLE, "<$from") or die("ERROR: cannot read $from: $!\n"); $content = <HANDLE>; close(HANDLE); ! open(HANDLE, ">$to") or die("ERROR: cannot write $from: $!\n"); if (defined($content)) { print(HANDLE $content); --- 666,673 ---- local *HANDLE; ! open(HANDLE, "<", $from) or die("ERROR: cannot read $from: $!\n"); $content = <HANDLE>; close(HANDLE); ! open(HANDLE, ">", $to) or die("ERROR: cannot write $from: $!\n"); if (defined($content)) { print(HANDLE $content); *************** *** 875,879 **** local *HANDLE; ! open(HANDLE, "<$filename") || return undef; $content = <HANDLE>; close(HANDLE); --- 875,879 ---- local *HANDLE; ! open(HANDLE, "<", $filename) || return undef; $content = <HANDLE>; close(HANDLE); *************** *** 904,908 **** $file = abs_path($file); chdir($dir); ! open(HANDLE, "tar xvfz $file 2>/dev/null|") or die("ERROR: could not process package $file\n"); while (<HANDLE>) { --- 904,908 ---- $file = abs_path($file); chdir($dir); ! open(HANDLE, "-|", "tar xvfz '$file' 2>/dev/null") or die("ERROR: could not process package $file\n"); while (<HANDLE>) { *************** *** 945,949 **** local *HANDLE; ! open(HANDLE, ">$filename") || return 0; print(HANDLE $content); close(HANDLE) || return 0; --- 945,949 ---- local *HANDLE; ! open(HANDLE, ">", $filename) || return 0; print(HANDLE $content); close(HANDLE) || return 0; *************** *** 963,967 **** my $count = 0; ! open(HANDLE, "tar tfz $filename|") or return undef; while (<HANDLE>) { if (/\.da$/ || /\.gcda$/) { --- 963,967 ---- my $count = 0; ! open(HANDLE, "-|", "tar tfz '$filename'") or return undef; while (<HANDLE>) { if (/\.da$/ || /\.gcda$/) { *************** *** 1617,1621 **** # Open compressed file ! open(INFO_HANDLE, "gunzip -c $_[0]|") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); --- 1617,1621 ---- # Open compressed file ! open(INFO_HANDLE, "-|", "gunzip -c '$_[0]'") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); *************** *** 1624,1628 **** { # Open decompressed file ! open(INFO_HANDLE, $_[0]) or die("ERROR: cannot read file $_[0]!\n"); } --- 1624,1628 ---- { # Open decompressed file ! open(INFO_HANDLE, "<", $_[0]) or die("ERROR: cannot read file $_[0]!\n"); } *************** *** 2480,2484 **** { info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">$output_filename") or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $total_trace); --- 2480,2484 ---- { info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">", $output_filename) or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $total_trace); *************** *** 2710,2714 **** info("Extracted $extracted files\n"); info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">$output_filename") or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $data); --- 2710,2714 ---- info("Extracted $extracted files\n"); info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">", $output_filename) or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $data); *************** *** 2766,2770 **** info("Deleted $removed files\n"); info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">$output_filename") or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $data); --- 2766,2770 ---- info("Deleted $removed files\n"); info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">", $output_filename) or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $data); *************** *** 3294,3298 **** # Open compressed file ! open(HANDLE, "gunzip -c $diff_file|") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); --- 3294,3298 ---- # Open compressed file ! open(HANDLE, "-|", "gunzip -c '$diff_file'") or die("ERROR: cannot start gunzip to decompress ". "file $_[0]!\n"); *************** *** 3301,3305 **** { # Open decompressed file ! open(HANDLE, $diff_file) or die("ERROR: cannot read file $_[0]!\n"); } --- 3301,3305 ---- { # Open decompressed file ! open(HANDLE, "<", $diff_file) or die("ERROR: cannot read file $_[0]!\n"); } *************** *** 3927,3931 **** { info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">$output_filename") or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $trace_data); --- 3927,3931 ---- { info("Writing data to $output_filename\n"); ! open(INFO_HANDLE, ">", $output_filename) or die("ERROR: cannot write to $output_filename!\n"); @result = write_info_file(*INFO_HANDLE, $trace_data); *************** *** 4014,4023 **** # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">/dev/null"); ! ($mode & 2) && open(STDERR, ">/dev/null"); system(@_); --- 4014,4023 ---- # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&", "STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&", "STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">", "/dev/null"); ! ($mode & 2) && open(STDERR, ">", "/dev/null"); system(@_); *************** *** 4029,4034 **** # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&OLD_STDERR"); return $result; --- 4029,4034 ---- # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&", "OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&", "OLD_STDERR"); return $result; *************** *** 4051,4055 **** local *HANDLE; ! if (!open(HANDLE, "<$filename")) { warn("WARNING: cannot read configuration file $filename\n"); --- 4051,4055 ---- local *HANDLE; ! if (!open(HANDLE, "<", $filename)) { warn("WARNING: cannot read configuration file $filename\n"); Index: gendesc =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/gendesc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gendesc 6 Aug 2010 11:25:12 -0000 1.14 --- gendesc 19 Nov 2010 15:45:01 -0000 1.15 *************** *** 154,158 **** my $empty_line = "ignore"; ! open(INPUT_HANDLE, $input_filename) or die("ERROR: cannot open $input_filename!\n"); --- 154,158 ---- my $empty_line = "ignore"; ! open(INPUT_HANDLE, "<", $input_filename) or die("ERROR: cannot open $input_filename!\n"); *************** *** 160,164 **** if ($output_filename) { ! open(OUTPUT_HANDLE, ">$output_filename") or die("ERROR: cannot create $output_filename!\n"); } --- 160,164 ---- if ($output_filename) { ! open(OUTPUT_HANDLE, ">", $output_filename) or die("ERROR: cannot create $output_filename!\n"); } Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** geninfo 19 Nov 2010 15:11:53 -0000 1.90 --- geninfo 19 Nov 2010 15:45:01 -0000 1.91 *************** *** 432,436 **** # for each data file processed local *DUMMY_HANDLE; ! open(DUMMY_HANDLE, ">$output_filename") or die("ERROR: cannot create $output_filename!\n"); close(DUMMY_HANDLE); --- 432,436 ---- # for each data file processed local *DUMMY_HANDLE; ! open(DUMMY_HANDLE, ">", $output_filename) or die("ERROR: cannot create $output_filename!\n"); close(DUMMY_HANDLE); *************** *** 946,950 **** { # Append to output file ! open(INFO_HANDLE, ">>$output_filename") or die("ERROR: cannot write to ". "$output_filename!\n"); --- 946,950 ---- { # Append to output file ! open(INFO_HANDLE, ">>", $output_filename) or die("ERROR: cannot write to ". "$output_filename!\n"); *************** *** 954,958 **** { # Open .info file for output ! open(INFO_HANDLE, ">$da_filename.info") or die("ERROR: cannot create $da_filename.info!\n"); } --- 954,958 ---- { # Open .info file for output ! open(INFO_HANDLE, ">", "$da_filename.info") or die("ERROR: cannot create $da_filename.info!\n"); } *************** *** 1324,1328 **** # Compare file contents ! open(SOURCE, $filename) or die("ERROR: cannot read $filename!\n"); --- 1324,1328 ---- # Compare file contents ! open(SOURCE, "<", $filename) or die("ERROR: cannot read $filename!\n"); *************** *** 1394,1398 **** local *INPUT; ! if (!open(INPUT, $_[0])) { if ($ignore_errors[$ERROR_GCOV]) --- 1394,1398 ---- local *INPUT; ! if (!open(INPUT, "<", $_[0])) { if ($ignore_errors[$ERROR_GCOV]) *************** *** 1546,1550 **** local *INPUT; ! if (!open(INPUT, $filename)) { if ($ignore_errors[$ERROR_GCOV]) { --- 1546,1550 ---- local *INPUT; ! if (!open(INPUT, "<", $filename)) { if ($ignore_errors[$ERROR_GCOV]) { *************** *** 1726,1730 **** my $result; ! open(GCOV_PIPE, "$gcov_tool -v |") or die("ERROR: cannot retrieve gcov version!\n"); $version_string = <GCOV_PIPE>; --- 1726,1730 ---- my $result; ! open(GCOV_PIPE, "-|", "$gcov_tool -v") or die("ERROR: cannot retrieve gcov version!\n"); $version_string = <GCOV_PIPE>; *************** *** 1814,1823 **** # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">/dev/null"); ! ($mode & 2) && open(STDERR, ">/dev/null"); debug("system(".join(' ', @_).")\n"); --- 1814,1823 ---- # Save old stdout and stderr handles ! ($mode & 1) && open(OLD_STDOUT, ">>&", "STDOUT"); ! ($mode & 2) && open(OLD_STDERR, ">>&", "STDERR"); # Redirect to /dev/null ! ($mode & 1) && open(STDOUT, ">", "/dev/null"); ! ($mode & 2) && open(STDERR, ">", "/dev/null"); debug("system(".join(' ', @_).")\n"); *************** *** 1830,1835 **** # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&OLD_STDERR"); return $result; --- 1830,1835 ---- # Restore old handles ! ($mode & 1) && open(STDOUT, ">>&", "OLD_STDOUT"); ! ($mode & 2) && open(STDERR, ">>&", "OLD_STDERR"); return $result; *************** *** 1852,1856 **** local *HANDLE; ! if (!open(HANDLE, "<$filename")) { warn("WARNING: cannot read configuration file $filename\n"); --- 1852,1856 ---- local *HANDLE; ! if (!open(HANDLE, "<", $filename)) { warn("WARNING: cannot read configuration file $filename\n"); *************** *** 1924,1928 **** local *HANDLE; ! if (!open(HANDLE, "<$filename")) { warn("WARNING: could not open $filename\n"); return undef; --- 1924,1928 ---- local *HANDLE; ! if (!open(HANDLE, "<", $filename)) { warn("WARNING: could not open $filename\n"); return undef; *************** *** 2130,2134 **** { # Append to output file ! open(INFO_HANDLE, ">>$output_filename") or die("ERROR: cannot write to ". "$output_filename!\n"); --- 2130,2134 ---- { # Append to output file ! open(INFO_HANDLE, ">>", $output_filename) or die("ERROR: cannot write to ". "$output_filename!\n"); *************** *** 2138,2142 **** { # Open .info file for output ! open(INFO_HANDLE, ">$graph_filename.info") or die("ERROR: cannot create $graph_filename.info!\n"); } --- 2138,2142 ---- { # Open .info file for output ! open(INFO_HANDLE, ">", "$graph_filename.info") or die("ERROR: cannot create $graph_filename.info!\n"); } *************** *** 2602,2606 **** local *HANDLE; ! open(HANDLE, "<$bb_filename") or goto open_error; binmode(HANDLE); while (!eof(HANDLE)) { --- 2602,2606 ---- local *HANDLE; ! open(HANDLE, "<", $bb_filename) or goto open_error; binmode(HANDLE); while (!eof(HANDLE)) { *************** *** 2779,2783 **** local *HANDLE; ! open(HANDLE, "<$bbg_filename") or goto open_error; binmode(HANDLE); # Read magic --- 2779,2783 ---- local *HANDLE; ! open(HANDLE, "<", $bbg_filename) or goto open_error; binmode(HANDLE); # Read magic *************** *** 3013,3017 **** local *HANDLE; ! open(HANDLE, "<$gcno_filename") or goto open_error; binmode(HANDLE); # Read magic --- 3013,3017 ---- local *HANDLE; ! open(HANDLE, "<", $gcno_filename) or goto open_error; binmode(HANDLE); # Read magic |
From: Peter O. <obe...@us...> - 2010-11-19 15:12:02
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21396 Modified Files: geninfo Log Message: geninfo: ignore <built-in>.gcov files The gcov tool will sometimes create a file <built-in>.gcov for code which was added by gcc itself during compilation. Since there isn't any source available for such code, geninfo will fail. Fix this by skipping these files while capturing code coverage data. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** geninfo 28 Oct 2010 14:17:57 -0000 1.89 --- geninfo 19 Nov 2010 15:11:53 -0000 1.90 *************** *** 969,972 **** --- 969,975 ---- my $num; + # Skip gcov file for gcc built-in code + next if ($gcov_file eq "<built-in>.gcov"); + ($source, $object) = read_gcov_header($gcov_file); |
From: Peter O. <obe...@us...> - 2010-10-28 14:18:04
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15769 Modified Files: geninfo Log Message: geninfo: add function comment Add comment explaining data structures used by function derive_data. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** geninfo 28 Oct 2010 14:16:34 -0000 1.88 --- geninfo 28 Oct 2010 14:17:57 -0000 1.89 *************** *** 621,624 **** --- 621,643 ---- + # + # derive_data(contentdata, funcdata, bbdata) + # + # Calculate function coverage data by combining line coverage data and the + # list of lines belonging to a function. + # + # contentdata: [ instr1, count1, source1, instr2, count2, source2, ... ] + # instr<n>: Instrumentation flag for line n + # count<n>: Execution count for line n + # source<n>: Source code for line n + # + # funcdata: [ count1, func1, count2, func2, ... ] + # count<n>: Execution count for function number n + # func<n>: Function name for function number n + # + # bbdata: function_name -> [ line1, line2, ... ] + # line<n>: Line number belonging to the corresponding function + # + sub derive_data($$$) { |