All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST
@ 2017-07-31 14:07 Stefan Hajnoczi
  2017-07-31 14:07 ` [Qemu-devel] [PATCH v2 1/2] trace: add TRACE_<event>_BACKEND_DSTATE() Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stefan Hajnoczi @ 2017-07-31 14:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Denis V. Lunev, Daniel P. Berrange, Lluís Vilanova,
	Stefan Hajnoczi

v2:
 * Don't special-case QEMU dstate [Daniel Berrange]
 * Use _backends() postfix to clarify function purpose [Lluís]

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: add trace_event_get_state_backends()

 docs/devel/tracing.txt                |  2 +-
 trace/control.h                       | 18 +++++++++++++++++-
 hw/usb/hcd-ohci.c                     | 13 +++++--------
 net/colo-compare.c                    | 11 ++++++-----
 net/filter-rewriter.c                 |  4 ++--
 scripts/tracetool/__init__.py         |  1 +
 scripts/tracetool/backend/__init__.py |  3 +++
 scripts/tracetool/backend/dtrace.py   | 12 ++++++++++++
 scripts/tracetool/backend/ftrace.py   |  5 +++++
 scripts/tracetool/backend/log.py      |  5 +++++
 scripts/tracetool/backend/simple.py   |  5 +++++
 scripts/tracetool/backend/syslog.py   |  5 +++++
 scripts/tracetool/backend/ust.py      |  5 +++++
 scripts/tracetool/format/h.py         | 10 ++++++++++
 14 files changed, 82 insertions(+), 17 deletions(-)

-- 
2.13.3

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

end of thread, other threads:[~2017-08-01  9:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-31 14:07 [Qemu-devel] [PATCH v2 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST Stefan Hajnoczi
2017-07-31 14:07 ` [Qemu-devel] [PATCH v2 1/2] trace: add TRACE_<event>_BACKEND_DSTATE() Stefan Hajnoczi
2017-07-31 15:16   ` Daniel P. Berrange
2017-07-31 16:35     ` Stefan Hajnoczi
2017-08-01  9:23       ` Daniel P. Berrange
2017-07-31 14:07 ` [Qemu-devel] [PATCH v2 2/2] trace: add trace_event_get_state_backends() Stefan Hajnoczi
2017-07-31 15:09   ` Lluís Vilanova
2017-07-31 16:33     ` Stefan Hajnoczi
2017-07-31 17:39       ` Lluís Vilanova
2017-08-01  9:27   ` Daniel P. Berrange
2017-08-01  9:38 ` [Qemu-devel] [PATCH v2 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.