On 8/25/25 09:03, Manos Pitsidianakis wrote:
+def expand_format_string(c_fmt, prefix=""):
(Pedantic comment) let's put type annotations in function signatures
when possible, these seem to handle `str` mostly so this should be
simple. This should catch basic errors like passing/returning `str |
None` or wrong types altogether.
Not pedantic, I have a full conversion of tracetool to add mypy
annotations... but it's on top of these patches. :)
I can reorder them and post the conversion first, depending on what the
maintainers prefer.
@@ -0,0 +1,76 @@
+# -*- coding: utf-8 -*-
This was probably copied verbatim from other tracetool files, but IIUC
it's not needed, utf-8 is the default encoding if there's no `coding`
declaration.
Also, missing SPDX header as a new file
Ok I can do that for all files, too.
+ if "tcg-exec" in e.properties:
+ # a single define for the two "sub-events"
+ out('const _TRACE_%(name)s_ENABLED: bool = %(enabled)s;',
+ name=e.original.name.upper(),
What's the difference between e.original.name and e.name?
Good point---anything to do with e.original is dead code. I'll add a
patch in front to drop it.
Paolo