gooftool: Record VPD to eventlog in VerifyVPD

The function hwid_utils.GetVPDData() needs `hwid_run_vpd`=True to get
VPD from commands. The default of `hwid_run_vpd` is False, so we usually
log nothing in VerifyHWID().
We use VPDTool to get VPD and log VPD in VerifyVPD instead.

BUG=b:185098698
TEST=Manually test

Change-Id: Ie437557f151eaccc52ac01c4d1476956b81f74d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/2820822
Reviewed-by: Cheng Yueh <cyueh@chromium.org>
Reviewed-by: Stimim Chen <stimim@chromium.org>
Reviewed-by: Yilin Yang (kerker) <kerker@chromium.org>
Tested-by: Chun-Tsen Kuo <chuntsen@chromium.org>
Commit-Queue: Chun-Tsen Kuo <chuntsen@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 987ce9d..2a2f8ea 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -361,6 +361,9 @@
 
   Check if mandatory fields are set, and deprecated fields don't exist.
   """
+  ro_vpd = vpd.VPDTool().GetAllData(partition=vpd.VPD_READONLY_PARTITION_NAME)
+  rw_vpd = vpd.VPDTool().GetAllData(partition=vpd.VPD_READWRITE_PARTITION_NAME)
+  event_log.Log('vpd', ro=FilterDict(ro_vpd), rw=FilterDict(rw_vpd))
   return GetGooftool(options).VerifyVPD()
 
 
@@ -961,7 +964,6 @@
                                    infile=options.hwid_vpd_data_file)
 
   event_log.Log('probed_results', probed_results=FilterDict(probed_results))
-  event_log.Log('vpd', vpd=FilterDict(vpd_data))
 
   hwid_utils.VerifyHWID(database, encoded_string, probed_results,
                         device_info, vpd_data, options.rma_mode)