| e2e182be | 29-Sep-2025 |
Tanish Desai <tanishdesai37@gmail.com> |
tracetool: Add Rust format support
Generating .rs files makes it possible to support tracing in rust. This support comprises a new format, and common code that converts the C expressions in trace-ev
tracetool: Add Rust format support
Generating .rs files makes it possible to support tracing in rust. This support comprises a new format, and common code that converts the C expressions in trace-events to Rust. In particular, types need to be converted, and PRI macros expanded.
As of this commit no backend generates Rust code, but it is already possible to use tracetool to generate Rust sources; they are not functional but they compile and contain tracepoint functions.
[Move Rust argument conversion from Event to Arguments; string support. - Paolo]
Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-9-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| 809caa0d | 29-Sep-2025 |
Tanish Desai <tanishdesai37@gmail.com> |
tracetool: add CHECK_TRACE_EVENT_GET_STATE
Add a new attribute CHECK_TRACE_EVENT_GET_STATE to the backends. When present and True, the code generated by the generate function is wrapped in a conditi
tracetool: add CHECK_TRACE_EVENT_GET_STATE
Add a new attribute CHECK_TRACE_EVENT_GET_STATE to the backends. When present and True, the code generated by the generate function is wrapped in a conditional that checks whether the event is enabled; this removes the need for repeating the same conditional in multiple backends.
Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250929154938.594389-7-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| 4c2f770f | 29-Sep-2025 |
Paolo Bonzini <pbonzini@redhat.com> |
tracetool: remove dead code
Remove a bunch of dead code from tracetool.
In particular, there are no tcg-exec events anymore and the sub-event functionality was only used for it.
Reviewed-by: Stefa
tracetool: remove dead code
Remove a bunch of dead code from tracetool.
In particular, there are no tcg-exec events anymore and the sub-event functionality was only used for it.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-3-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| c47db9b1 | 16-Sep-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
tracetool: drop the probe "__nocheck__" wrapping
Every generated inline probe function is wrapped with a trivial caller that has a hard-coded condition test:
static inline void _nocheck__trace_te
tracetool: drop the probe "__nocheck__" wrapping
Every generated inline probe function is wrapped with a trivial caller that has a hard-coded condition test:
static inline void _nocheck__trace_test_wibble(void * context, int value) { tracepoint(qemu, test_wibble, context, value); }
static inline void trace_test_wibble(void * context, int value) { if (true) { _nocheck__trace_test_wibble(context, value); } }
This was introduced for TCG probes back in
864a2178: trace: [tcg] Do not generate TCG code to trace dynamically-disabled events
but is obsolete since
126d4123 tracing: excise the tcg related from tracetool
This commit removes the wrapping such that we have
static inline void trace_test_wibble(void * context, int value) { tracepoint(qemu, test_wibble, context, value); }
The default build of qemu-system-x86_64 on Fedora with the 'log' backend, has its size reduced by 1 MB
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20250916081638.764020-7-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| 52d1ec29 | 16-Sep-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
tracetool: include SPDX-License-Identifier in generated files
While these files are auto-generated, a later commit will add reference output to git, so having SPDX-License-Identifier is desirable.
tracetool: include SPDX-License-Identifier in generated files
While these files are auto-generated, a later commit will add reference output to git, so having SPDX-License-Identifier is desirable.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20250916081638.764020-5-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| 09612de7 | 06-Jan-2021 |
Daniel P. Berrangé <berrange@redhat.com> |
tracetool: also strip %l and %ll from systemtap format strings
All variables are 64-bit and so %l / %ll are not required, and the latter is actually invalid:
$ sudo stap -e 'probe begin{printf ("
tracetool: also strip %l and %ll from systemtap format strings
All variables are 64-bit and so %l / %ll are not required, and the latter is actually invalid:
$ sudo stap -e 'probe begin{printf ("BEGIN")}' -I . parse error: invalid or missing conversion specifier saw: operator ',' at ./qemu-system-x86_64-log.stp:15118:101 source: printf("%d@%d vhost_vdpa_set_log_base dev: %p base: 0x%x size: %llu refcnt: %d fd: %d log: %p\n", pid(), gettimeofday_ns(), dev, base, size, refcnt, fd, log)
^
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Laurent Vivier <lvivier@redhat.com> Message-id: 20210106130239.1004729-1-berrange@redhat.com
[Fixed "simiarly" typo found by Laurent Vivier <lvivier@redhat.com> --Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
| 13d4ff07 | 12-Aug-2019 |
Markus Armbruster <armbru@redhat.com> |
trace: Do not include qom/cpu.h into generated trace.h
docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files
trace: Do not include qom/cpu.h into generated trace.h
docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down."
Commit 4815185902 "trace: Add per-vCPU tracing states for events with the 'vcpu' property" made them all include qom/cpu.h via control-internal.h. qom/cpu.h in turn includes about thirty headers. Ouch.
Per-vCPU tracing is currently not supported in sub-directories' trace-events. In other words, qom/cpu.h can only be used in trace-root.h, not in any trace.h.
Split trace/control-vcpu.h off trace/control.h and trace/control-internal.h. Have the generated trace.h include trace/control.h (which no longer includes qom/cpu.h), and trace-root.h include trace/control-vcpu.h (which includes it).
The resulting improvement is a bit disappointing: in my "build everything" tree, some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h) depend on a trace.h, and about 600 of them no longer depend on qom/cpu.h. But more than 1300 others depend on trace-root.h. More work is clearly needed. Left for another day.
Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190812052359.30071-8-armbru@redhat.com>
show more ...
|