qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] tracetool: remove no_check_foo() and if(true){..} blocks
@ 2025-08-04 11:20 Tanish Desai
  2025-08-04 11:20 ` [PATCH 1/2] tracetool: add CHECK_TRACE_EVENT_GET_STATE Tanish Desai
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tanish Desai @ 2025-08-04 11:20 UTC (permalink / raw)
  To: tanishdesai37, qemu-devel, pbonzini; +Cc: Stefan Hajnoczi, Mads Ynddal

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   |  4 +---
 scripts/tracetool/backend/log.py      |  6 ++----
 scripts/tracetool/backend/simple.py   |  9 ++------
 scripts/tracetool/backend/syslog.py   |  8 ++-----
 scripts/tracetool/format/h.py         | 30 ++++++++++-----------------
 7 files changed, 37 insertions(+), 47 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2025-08-06  2:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 11:20 [PATCH 0/2] tracetool: remove no_check_foo() and if(true){..} blocks Tanish Desai
2025-08-04 11:20 ` [PATCH 1/2] tracetool: add CHECK_TRACE_EVENT_GET_STATE Tanish Desai
2025-08-05 20:11   ` Daniel P. Berrangé
2025-08-05 22:32     ` Paolo Bonzini
2025-08-06  2:27       ` Tanish Desai
2025-08-04 11:20 ` [PATCH 2/2] tracetool/format: remove redundent trace-event checks Tanish Desai
2025-08-05 20:10   ` Daniel P. Berrangé
2025-08-05 21:02 ` [PATCH 0/2] tracetool: remove no_check_foo() and if(true){..} blocks Daniel P. Berrangé

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).