On 13/10/21 09:43, Paolo Bonzini wrote:
On 12/10/21 20:15, Thomas Huth wrote:
Old output with --help:
--enable-trace-backend=B Set trace backend
Available backends: nop, dtrace, ftrace,
simple, stderr, ust
New output:
--enable-trace-backends=CHOICE
Set available tracing backends [log]
Why does it fail to list the choices here? ... it works for the other
options like "--enable-malloc"?
Oh, that's a pity: array options don't include the choices in their
introspection data. I'll fix it up ad hoc and submit a patch to Meson.
---------------- 8< ----------------
From: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH] meson-buildoptions: restore list of tracing backends
Manually patch the introspection data to include the tracing backends.
This works around a deficiency in Meson that will be fixed by
https://github.com/mesonbuild/meson/pull/9395.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/meson-buildoptions.py | 18 +++++++++++++++++-
scripts/meson-buildoptions.sh | 3 ++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index 54b591d8a4..256523c09d 100755
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -66,7 +66,7 @@ def sh_print(line=""):
def help_line(left, opt, indent, long):
- right = f"{opt['description']}"
+ right = f'{opt["description"]}'
if long:
value = value_to_help(opt["value"])
if value != "auto":
@@ -150,7 +150,23 @@ def print_parse(options):
print("}")
+def fixup_options(options):
+ # Meson <= 0.60 does not include the choices in array options, fix that up
+ for opt in options:
+ if opt["name"] == "trace_backends":
+ opt["choices"] = [
+ "dtrace",
+ "ftrace",
+ "log",
+ "nop",
+ "simple",
+ "syslog",
+ "ust",
+ ]