Skip to contentSkip to conversation

hw/uefi: Create and use trace.h wrapper header

PATCH In review Peter Maydell 2 participants 2 messages Jul 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/uefi: Create and use trace.h wrapper header

The documentation of the trace subsystem (docs/devel/tracing.rst) says that each subdirectory which uses trace events should create a wrapper trace.h file which includes the trace/trace-foo.h generated header, and that .c files then #include "trace.h".

We didn't follow this pattern in hw/uefi/. Correct this by creating and using the trace.h wrapper header.

---
 hw/uefi/trace.h              | 2 ++
 hw/uefi/var-service-core.c   | 2 +-
 hw/uefi/var-service-policy.c | 2 +-
 hw/uefi/var-service-utils.c  | 2 +-
 hw/uefi/var-service-vars.c   | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)
 create mode 100644 hw/uefi/trace.h
hw/uefi/trace.h new file +2 -0
new file mode 100644
index 00000000000..6aa1c938960
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include "trace/trace-hw_uefi.h"
hw/uefi/var-service-core.c +1 -1
index 4836a0cb811..feec5a59583 100644
@@ -12,7 +12,7 @@
 #include "hw/uefi/var-service-api.h"
 #include "hw/uefi/var-service-edk2.h"
 
-#include "trace/trace-hw_uefi.h"
+#include "trace.h"
 
 static int uefi_vars_pre_load(void *opaque)
 {
hw/uefi/var-service-policy.c +1 -1
index 3b1155fe4ea..58da4adbeba 100644
@@ -14,7 +14,7 @@
 #include "hw/uefi/var-service-api.h"
 #include "hw/uefi/var-service-edk2.h"
 
-#include "trace/trace-hw_uefi.h"
+#include "trace.h"
 
 static void calc_policy(uefi_var_policy *pol);
 
hw/uefi/var-service-utils.c +1 -1
index c9ef46570f4..258013f436a 100644
@@ -8,7 +8,7 @@
 
 #include "hw/uefi/var-service.h"
 
-#include "trace/trace-hw_uefi.h"
+#include "trace.h"
 
 /* ------------------------------------------------------------------ */
 
hw/uefi/var-service-vars.c +1 -1
index 7f98d77a38d..37d05b71cf7 100644
@@ -12,7 +12,7 @@
 #include "hw/uefi/var-service-api.h"
 #include "hw/uefi/var-service-edk2.h"
 
-#include "trace/trace-hw_uefi.h"
+#include "trace.h"
 
 #define EFI_VARIABLE_ATTRIBUTE_SUPPORTED                                \
     (EFI_VARIABLE_NON_VOLATILE |                                        \
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Peter Maydell

The documentation of the trace subsystem (docs/devel/tracing.rst) says that each subdirectory which uses trace events should create a wrapper trace.h file which includes the trace/trace-foo.h generated header, and that .c files then #include "trace.h".

We didn't follow this pattern in hw/uefi/. Correct this by creating and using the trace.h wrapper header.

Quoted 8 lines
---
  hw/uefi/trace.h              | 2 ++
  hw/uefi/var-service-core.c   | 2 +-
  hw/uefi/var-service-policy.c | 2 +-
  hw/uefi/var-service-utils.c  | 2 +-
  hw/uefi/var-service-vars.c   | 2 +-
  5 files changed, 6 insertions(+), 4 deletions(-)

create mode 100644 hw/uefi/trace.h