# This module contains the functionality to generate build report after\r
# build all target completes successfully.\r
#\r
-# Copyright (c) 2010, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
import textwrap\r
import traceback\r
import sys\r
+import time\r
from datetime import datetime\r
+from StringIO import StringIO\r
from Common import EdkLogger\r
+from Common.Misc import SaveFileOnChange\r
from Common.Misc import GuidStructureByteArrayToGuidString\r
from Common.Misc import GuidStructureStringToGuidString\r
from Common.InfClassObject import gComponentType2ModuleType\r
-from Common.BuildToolError import FILE_OPEN_FAILURE\r
from Common.BuildToolError import FILE_WRITE_FAILURE\r
from Common.BuildToolError import CODE_ERROR\r
\r
for Platform in Wa.BuildDatabase.WorkspaceDb.PlatformList:\r
for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:\r
DscDefaultValue = Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DefaultValue\r
- self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue\r
+ if DscDefaultValue:\r
+ self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue\r
\r
##\r
# Generate report for PCD information\r
for Pa in Wa.AutoGenObjectList:\r
for Module in Pa.LibraryAutoGenList + Pa.ModuleAutoGenList:\r
#\r
+ # BASE typed modules are EFI agnostic, so we need not scan\r
+ # their source code to find PPI/Protocol produce or consume\r
+ # information.\r
+ #\r
+ if Module.ModuleType == "BASE":\r
+ continue\r
+ #\r
# Add module referenced source files\r
#\r
self._SourceList.append(str(Module))\r
\r
try:\r
from Eot.Eot import Eot\r
+\r
#\r
- # Invoke EOT tool\r
+ # Invoke EOT tool and echo its runtime performance\r
#\r
+ EotStartTime = time.time()\r
Eot(CommandLineOption=False, SourceFileList=SourceList, GuidList=GuidList,\r
FvFileList=' '.join(FvFileList), Dispatch=DispatchList, IsInit=True)\r
-\r
+ EotEndTime = time.time()\r
+ EotDuration = time.strftime("%H:%M:%S", time.gmtime(int(round(EotEndTime - EotStartTime))))\r
+ EdkLogger.quiet("EOT run time: %s\n" % EotDuration)\r
+ \r
#\r
# Parse the output of EOT tool\r
#\r
def GenerateReport(self, BuildDuration):\r
if self.ReportFile:\r
try:\r
- File = open(self.ReportFile, "w+")\r
- except IOError:\r
- EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=self.ReportFile)\r
- try:\r
+ File = StringIO('')\r
for (Wa, MaList) in self.ReportList:\r
PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType)\r
- EdkLogger.quiet("Report successfully saved to %s" % os.path.abspath(self.ReportFile))\r
+ SaveFileOnChange(self.ReportFile, File.getvalue(), False)\r
+ EdkLogger.quiet("Build report can be found at %s" % os.path.abspath(self.ReportFile))\r
except IOError:\r
EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=self.ReportFile)\r
except:\r