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

Peter Maydell posted 1 patch 8 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250707142412.558561-1-peter.maydell@linaro.org
Maintainers: Gerd Hoffmann <kraxel@redhat.com>
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
[PATCH] hw/uefi: Create and use trace.h wrapper header
Posted by Peter Maydell 8 months, 1 week ago
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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 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

diff --git a/hw/uefi/trace.h b/hw/uefi/trace.h
new file mode 100644
index 00000000000..6aa1c938960
--- /dev/null
+++ b/hw/uefi/trace.h
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include "trace/trace-hw_uefi.h"
diff --git a/hw/uefi/var-service-core.c b/hw/uefi/var-service-core.c
index 4836a0cb811..feec5a59583 100644
--- a/hw/uefi/var-service-core.c
+++ b/hw/uefi/var-service-core.c
@@ -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)
 {
diff --git a/hw/uefi/var-service-policy.c b/hw/uefi/var-service-policy.c
index 3b1155fe4ea..58da4adbeba 100644
--- a/hw/uefi/var-service-policy.c
+++ b/hw/uefi/var-service-policy.c
@@ -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);
 
diff --git a/hw/uefi/var-service-utils.c b/hw/uefi/var-service-utils.c
index c9ef46570f4..258013f436a 100644
--- a/hw/uefi/var-service-utils.c
+++ b/hw/uefi/var-service-utils.c
@@ -8,7 +8,7 @@
 
 #include "hw/uefi/var-service.h"
 
-#include "trace/trace-hw_uefi.h"
+#include "trace.h"
 
 /* ------------------------------------------------------------------ */
 
diff --git a/hw/uefi/var-service-vars.c b/hw/uefi/var-service-vars.c
index 7f98d77a38d..37d05b71cf7 100644
--- a/hw/uefi/var-service-vars.c
+++ b/hw/uefi/var-service-vars.c
@@ -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 |                                        \
-- 
2.43.0
Re: [PATCH] hw/uefi: Create and use trace.h wrapper header
Posted by Philippe Mathieu-Daudé 8 months, 1 week ago
On 7/7/25 16:24, Peter Maydell wrote:
> 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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   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

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>