tools/summarise_gcc_errors.pl
author William Roberts <williamr@symbian.org>
Fri, 26 Mar 2010 16:26:39 +0000
changeset 2 f49995c19d9d
parent 1 fd0863fd52e5
child 3 5578c2bec847
permissions -rw-r--r--
Update the summary based on the latest gcce CompilerCompatibility package builds as at 2010-03-26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#! perl
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2010 Symbian Foundation Ltd
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# 
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# Perl script to summarise GCC logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
use strict;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
use Getopt::Long;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
sub Usage($)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
  my ($msg) = @_;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
  print "$msg\n\n" if ($msg ne "");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	print <<'EOF';
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
summarise_gcc_errors.pl - simple script for analysing gcc error logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
This script will read a collection of GCC output logs and summarise
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
the error messages in various useful ways.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
Options:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
-warnings      process warnings as well as errors
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
-verbose       list the files associated with each error
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
EOF
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  exit (1);  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  }
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
my $warnings = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
my $verbose = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
# Analyse the rest of command-line parameters
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
if (!GetOptions(
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
    "w|warnings" => \$warnings,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
    "v|verbose" => \$verbose,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
    ))
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
  Usage("Invalid argument");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
  }
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
my %files;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
my %errors_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
my %error_count_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
my %errors;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
my %message_ids;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
my %files_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
my %messages_by_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
my %unique_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
my %all_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
my $next_message_id = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
my $line;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
while ($line = <>)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
	# M:/epoc32/include/elements/nm_interfaces.h:255: warning: dereferencing type-punned pointer will break strict-aliasing rules
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
	# M:/epoc32/include/f32file.h:2169: warning: invalid access to non-static data member 'TVolFormatParam::iUId'  of NULL object
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
	# M:/epoc32/include/f32file.h:2169: warning: (perhaps the 'offsetof' macro was used incorrectly)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: wrong number of template arguments (3, should be 4)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	# M:/epoc32/include/elements/nm_signatures.h:496: error: provided for 'template<class TSIGNATURE, int PAYLOADATTRIBOFFSET, class TATTRIBUTECREATIONPOLICY, int PAYLOADBUFFERMAXLEN> class Messages::TSignatureWithPolymorphicPayloadMetaType'
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: invalid type in declaration before ';' token
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	if ($line =~ /(^...*):(\d+): ([^:]+): (.*)$/)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
		my $filename = $1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
		my $lineno = $2;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
		my $messagetype = $3;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
		my $message = $4;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
		if ($messagetype eq "note")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
			next;		# ignore notes
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
		if ($messagetype eq "warning" && !$warnings)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
			next;		# ignore warnings
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
		$filename =~ s/^.://;		# remove drive letter
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
		$message =~ s/&amp;/&/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
		$message =~ s/&gt;/>/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
		$message =~ s/&lt;/</g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
		$message =~ s/&#39;/'/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
		my $generic_message = "$messagetype: $message";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
		$generic_message =~ s/'offsetof'/"offsetof"/;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
		$generic_message =~ s/'([^a-zA-Z])'/"\1"/g;	# don't catch ';' in next substitution
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
		$generic_message =~ s/['`][^']+'/XX/g;	# suppress quoted bits of the actual instance
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
		my $message_id = $next_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
		if (!defined $message_ids{$generic_message})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
			$next_message_id++;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
			$message_ids{$generic_message} = $message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
			$messages_by_id{$message_id} = $generic_message;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
			$all_message_counts{$message_id} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
		else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
			$message_id = $message_ids{$generic_message};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
			$all_message_counts{$message_id} += 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
		my $instance = sprintf("%s:%d: %s-#%d", $filename, $lineno, $messagetype, $message_id);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
		
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
		if (defined $files{$instance})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
			# already seen this one
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
			next;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
		else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
			if (!defined $unique_message_counts{$message_id})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
				$unique_message_counts{$message_id} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
			else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
				$unique_message_counts{$message_id} += 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
			$files{$instance} = $message;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
			if (!defined $files_by_message_id{$message_id})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
				$files_by_message_id{$message_id} = $filename;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
			else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
				$files_by_message_id{$message_id} .= "\n$filename";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
					
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
			my $error = sprintf "%-5d: %s: %s", $lineno, $messagetype, $message;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
			if (!defined $errors_by_file{$filename})
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
				$errors_by_file{$filename} = $error;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
				$error_count_by_file{$filename} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
			else
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
				{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
				$errors_by_file{$filename} .= "\n$error";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
				$error_count_by_file{$filename} += 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
				}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
			}	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
		next;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
# clean up the file lists
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
my %filecount_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
foreach my $id (keys %files_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
	my @longlist = split /\n/, $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
	my %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
	foreach my $file (@longlist)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
		$uniq{$file} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
	my $uniqlist = join( "\n\t", sort keys %uniq);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
	$files_by_message_id{$id} = $uniqlist;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
	$filecount_by_message_id{$id} = scalar keys %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
print "\n\n====Occurrences of messages (distinct, all)\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
foreach my $id ( sort {$unique_message_counts{$b} <=> $unique_message_counts{$a}} keys %unique_message_counts)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
	printf "%-6d\t%-6d\t%s\n", $unique_message_counts{$id}, $all_message_counts{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   178
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
print "\n\n====Files affected per message\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   180
foreach my $id ( sort {$filecount_by_message_id{$b} <=> $filecount_by_message_id{$a}} keys %filecount_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   181
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
	printf "%-6d\t%s\n", $filecount_by_message_id{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
	if ($verbose)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   184
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   185
		print "\t", $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   186
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   187
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   188
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   189
print "\n\n====Affected files by package\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   190
my $current_package = "";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   191
my @currentfiles;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   192
foreach my $file (sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   193
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   194
	my ($root, $sf, $layer, $packagename, @rest) = split /[\/\\]/, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   195
	my $package = "$sf/$layer/$packagename";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   196
	if ($layer eq "include")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   197
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   198
		$package = "$sf/$layer";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
	if ($package ne $current_package)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
		if ($current_package ne "")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
			printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
			print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   206
			print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
		$current_package = $package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
		@currentfiles = ();
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
	my $filedetails = sprintf "\t%-6d\t%s", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
	push @currentfiles, $filedetails;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
print "\n\n====Messages by file\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
foreach my $file ( sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   221
	my @details = split "\n", $errors_by_file{$file};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
	printf "%-6d\t%s\n\t", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
	print join("\n\t", @details);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
	print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   226