]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Scripts/Ds5/build_report.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPlatformPkg / Scripts / Ds5 / build_report.py
1 #
2 # Copyright (c) 2011-2012, ARM Limited. All rights reserved.
3 #
4 # SPDX-License-Identifier: BSD-2-Clause-Patent
5 #
6
7 import re
8
9 class BuildReport:
10 PCDs = {}
11
12 def parse_platform_summary(self, file):
13 pass
14
15 def parse_pcd_report(self, report_file):
16 pcd_reg = re.compile(" (\*P|\*F|\*M| ) (\w+)(\ +)\: (.*) \((\w+)\) = (.*)\n")
17
18 for line in report_file.xreadlines():
19 stripped_line = line.strip()
20 if re.match("\<=+\>", stripped_line):
21 return
22 elif re.match("g.*Guid", stripped_line):
23 guid = stripped_line
24 self.PCDs[guid] = {}
25 else:
26 m = pcd_reg.match(line)
27 if m:
28 self.PCDs[guid][m.group(2)] = (m.group(6).strip(),m.group(5))
29
30 def parse_firmware_device(self, file):
31 pass
32
33 def parse_module_summary(self, file):
34 #print "Module Summary"
35 pass
36
37 CONST_SECTION_HEADERS = [('Platform Summary', parse_platform_summary),
38 ('Platform Configuration Database Report',parse_pcd_report),
39 ('Firmware Device (FD)',parse_firmware_device),
40 ('Module Summary',parse_module_summary)]
41
42 def __init__(self, filename = 'report.log'):
43 report_file = open(filename, 'r')
44 for line in report_file.xreadlines():
45 for section_header in BuildReport.CONST_SECTION_HEADERS:
46 if line.strip() == section_header[0]:
47 section_header[1](self, report_file)
48 #print self.PCDs