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


Reply via email to