qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tracetool: remove no_check_foo() and if(true){..} blocks
@ 2025-08-06 15:05 Tanish Desai
  2025-08-06 15:05 ` [PATCH v2 1/2] tracetool: add CHECK_TRACE_EVENT_GET_STATE Tanish Desai
  2025-08-06 15:05 ` [PATCH v2 2/2] tracetool/format: remove redundent trace-event checks Tanish Desai
  0 siblings, 2 replies; 9+ messages in thread
From: Tanish Desai @ 2025-08-06 15:05 UTC (permalink / raw)
  To: qemu-devel, pbonzini, tanishdesai37; +Cc: Mads Ynddal, Stefan Hajnoczi

This patch series eliminates unnecessary
if (true) { no_check_foo(...) } blocks and
integrates the no_check_foo(...) logic directly
into trace_foo(...). This results in cleaner,
more maintainable code generation.

A new backend attribute, TRACE_EVENT_GET_STATE,
is introduced. When enabled, it automatically
generates conditional block :
if (trace_event_get_state(...)) { ... }. The
generate() function emits code within this
conditional structure for that backend.

Previously, without TRACE_EVENT_GET_STATE,
each backend was required to manually implement
out("if (trace_event_get_state(...)) {") in its
generate() function, leading to code duplication.

Tanish Desai (2):
  tracetool: add CHECK_TRACE_EVENT_GET_STATE
  tracetool/format: remove redundent trace-event checks

 scripts/tracetool/__init__.py         |  1 -
 scripts/tracetool/backend/__init__.py | 26 ++++++++++++++++-------
 scripts/tracetool/backend/ftrace.py   | 12 +++++------
 scripts/tracetool/backend/log.py      | 10 ++++-----
 scripts/tracetool/backend/simple.py   |  9 ++------
 scripts/tracetool/backend/syslog.py   |  8 ++-----
 scripts/tracetool/format/h.py         | 30 ++++++++++-----------------
 7 files changed, 43 insertions(+), 53 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-20 12:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 15:05 [PATCH v2 0/2] tracetool: remove no_check_foo() and if(true){..} blocks Tanish Desai
2025-08-06 15:05 ` [PATCH v2 1/2] tracetool: add CHECK_TRACE_EVENT_GET_STATE Tanish Desai
2025-08-06 19:13   ` Daniel P. Berrangé
2025-08-07 10:35     ` Paolo Bonzini
2025-08-20 12:14       ` Daniel P. Berrangé
2025-08-07 19:23   ` Stefan Hajnoczi
2025-08-06 15:05 ` [PATCH v2 2/2] tracetool/format: remove redundent trace-event checks Tanish Desai
2025-08-06 16:53   ` Daniel P. Berrangé
2025-08-07 19:25   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).