qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/2] trace: fix trace_event_get_state() for Syst


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 0/2] trace: fix trace_event_get_state() for SystemTap and LTTng UST
Date: Fri, 28 Jul 2017 13:25:26 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/28/2017 12:20 PM, Stefan Hajnoczi wrote:
> 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(-)
>
looks good to me!

This also fixes the same issue not only in my code, but in

static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
and in colo code.

Reviewed-by: Denis V. Lunev <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]