feat: print vCPU ID

Include the vCPU ID alongside the VM ID when the vCPU's log buffer is
flushed.

Also cache the compiled regex in `hftest.py` so that matching is faster.

Change-Id: I5dd2025ed49525e64493d7ad3187b814b1debaa6
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/test/hftest/hftest.py b/test/hftest/hftest.py
index 704c0fd..b63e802 100755
--- a/test/hftest/hftest.py
+++ b/test/hftest/hftest.py
@@ -41,6 +41,8 @@
 HFTEST_CTRL_GET_COMMAND_LINE = "[hftest_ctrl:get_command_line]"
 HFTEST_CTRL_FINISHED = "[hftest_ctrl:finished]"
 
+HFTEST_CTRL_JSON_REGEX = re.compile("^(VM|SP)0x[0-9a-fA-F]+@0x[0-9a-fA-F]+: ")
+
 HF_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(
     os.path.abspath(__file__))))
 DTC_SCRIPT = os.path.join(HF_ROOT, "build", "image", "dtc.py")
@@ -784,7 +786,7 @@
         lines_to_process = lines_to_process[hftest_start : hftest_end]
 
         for line in lines_to_process:
-            match = re.search(f"^(VM|SP) \d+: ", line)
+            match = HFTEST_CTRL_JSON_REGEX.search(line)
             if match is not None:
                 line = line[match.end():]
             if line.startswith(HFTEST_LOG_PREFIX):