deprecated/buildtools/buildsystemtools/docs/scanlog.txt
author Zheng Shen <zheng.shen@nokia.com>
Wed, 27 Oct 2010 19:35:19 +0800
changeset 664 44b0e894b7ab
parent 655 3f65fd25dfd4
permissions -rw-r--r--
Merge again
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
SCANLOG.PL
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     2
17/02/2003
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     3
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     4
1. Introduction
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     5
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     6
scanlog.pl is a utility for summarising a build log. It reports the time 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     7
taken for each phase of the build, and the numbers of fatal errors and warnings.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     8
For each component, the numbers of warnings and errors are accumulated across
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     9
all phases and reported by component.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    10
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    11
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    12
2. Log file format
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    13
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    14
scanlog expects the logfiles to have a particular structure for identifying 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
the phases and components. It will tolerate log files which don't fully conform
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
to this structure, but the reporting will have less detail.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
The expected structure is:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
=== <command for the phase>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
=== <phase> started Fri Feb  7 12:47:28 2003.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
=== <phase> == <component1>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
... build output
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
=== <phase> == <component2>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
... build output
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
=== <phase> == <componentN>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
... build output
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
=== <phase> finished Fri Feb  7 13:13:41 2003.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
<phase> should be a single word without spaces, for example "target".
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
The timestamps are optional and not processed by the current version of scanlog,
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
though they are being processed by other tools.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
For this example, scanlog would summarise this part of the log as
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
<command for the phase>		00:26:13	0	0
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
assuming that there are no errors or warnings detected.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
3. Errors and Warnings
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
Scanlog uses a set of regular expressions to identify lines in the log file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
which are usually associated with errors or warnings, for example:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
	/make(\[\d+\])?: \*\*\* /		-- e.g. make[2]: ***
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
which is the way that GNU make reports a failure. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
This rather simple approach can overstate the number of errors, particularly 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
given the nested makefile approach used by the Symbian build tools. It is
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
counting the symptoms of a failure rather than necessarily identifying the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
root cause.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
Errors are warnings are summarised according to the build phase (described above)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
and also accumulated across build phases and reported by component. If scanlog
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
is invoked with the additional -V argument, the lines counted as warnings and
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
errors are reported for each component, to aid problem diagnosis.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
4. Things not built...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
Scanlog also looks for lines which begin with "MISSING: ", which are normally
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
produced by the output of "abld -check build". The missing files are listed and
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
marked with the component which reported them, serving as an additional view of
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
what has actually failed if fatal errors are reported.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
5. List of patterns 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
Scanlog originally just looked for errors and warnings arising from the structure
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
of the Symbian build, but has increasingly gained patterns to detect output from
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
specific tools such as the ARM RealView compiler. This contributes to the "over
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
counting" of errors, but provides more useful "scanlog -V" output.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
Scanlog uses these patterns to identify errors:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
	/^MISSING COMPONENT (.*):.* find (.*)$/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
	/(ABLD|BLDMAKE) ERROR:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
	/FATAL ERROR\(S\):/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
	/fatal error U1073: .* make '(.*)'/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
	/fatal error U1077/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
	/warning U4010/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
	/make(\[\d+\])?: \*\*\* /
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
	/make(\[\d+\])?: .* not remade /
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
 	/"(.*)", line (\d+): (Error: +(.\d+.*?):.*)$/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
	/error: ((Internal fault):.*)$/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
	/Exception: STATUS_ACCESS_VIOLATION/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
	/target .*? given more than once in the same rule/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
	/^ERROR: /
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
The "warning U4010" pattern catches lines such as
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
  NMAKE : warning U4010: 'FINALCOPYFXCM' : build failed; /K specified, continuing ...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
which would arise from the use of nmake /k in situations which would otherwise 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
be fatal errors.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
Scanlog uses these patterns to identify warnings:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
	/Warning: Unmatched/i
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
	/^BLDMAKE WARNING:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
	/WARNING\(S\)/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
	/^WARNING: /
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
	/\(\d+\) : warning C/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
	/LINK : warning/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
	/:\d+: warning:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
	/"(.*)", line (\d+): (Warning: +(.\d+.*?):.*)$/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
	/^MAKEDEF WARNING:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
	/ERROR: bad relocation:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
    	/mwldsym\d+.exe: warning:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
	/^(\d+) warning/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
	/mwld.exe:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
	/^Command line warning/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
	/Usage Warning:/
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
The "ERROR: bad relocation" pattern catches messages from petran which are actually
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
just warnings, for example:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
  ERROR: bad relocation:  [00004f60] = 00000f68
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
Petran follows a heuristic in these cases, and to date there has never been a 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
runtime error attributed to this warning.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127