qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST
@ 2017-07-28  9:20 Stefan Hajnoczi
  2017-07-28  9:20 ` [Qemu-devel] [PATCH 1/2] trace: add TRACE_<event>_BACKEND_DSTATE() Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-07-28  9:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Denis V. Lunev, Lluís Vilanova, Stefan Hajnoczi

Trace events that compute their arguments can affect performance.  The
following idom can be used to avoid computing arguments when the trace event is
disabled:

  if (trace_event_get_state(TRACE_MY_EVENT)) {
      char *str = g_strdup_printf("Expensive string ...", ...);
      trace_my_event(str);
      g_free(str);
  }

Unfortunately this breaks the trace event for SystemTap and LTTng UST since
those tracers manage their own enabled/disabled state.

These patches add per-backend dstate to trace_event_get_state() so that the
trace event fires as expected when enabled via SystemTap or LTTng UST.

Stefan Hajnoczi (2):
  trace: add TRACE_<event>_BACKEND_DSTATE()
  trace: check backend dstate in trace_event_get_state()

 trace/control.h                       | 20 ++++++++++++++++++--
 scripts/tracetool/__init__.py         |  1 +
 scripts/tracetool/backend/__init__.py |  3 +++
 scripts/tracetool/backend/dtrace.py   | 12 ++++++++++++
 scripts/tracetool/backend/ftrace.py   |  2 +-
 scripts/tracetool/backend/log.py      |  3 ++-
 scripts/tracetool/backend/simple.py   |  2 +-
 scripts/tracetool/backend/syslog.py   |  3 ++-
 scripts/tracetool/backend/ust.py      |  5 +++++
 scripts/tracetool/format/h.py         | 10 ++++++++++
 10 files changed, 55 insertions(+), 6 deletions(-)

-- 
2.13.3

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

end of thread, other threads:[~2017-07-28 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28  9:20 [Qemu-devel] [PATCH 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST Stefan Hajnoczi
2017-07-28  9:20 ` [Qemu-devel] [PATCH 1/2] trace: add TRACE_<event>_BACKEND_DSTATE() Stefan Hajnoczi
2017-07-28  9:20 ` [Qemu-devel] [PATCH 2/2] trace: check backend dstate in trace_event_get_state() Stefan Hajnoczi
2017-07-28 11:05   ` Daniel P. Berrange
2017-07-28 15:56     ` Stefan Hajnoczi
2017-07-28 16:24       ` Daniel P. Berrange
2017-07-28 16:42     ` Lluís Vilanova
2017-07-28 10:25 ` [Qemu-devel] [PATCH 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST Denis V. Lunev

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