qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 14/21] trace: add support for plugin infrast


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [RFC PATCH 14/21] trace: add support for plugin infrastructure
Date: Sat, 6 Oct 2018 21:29:00 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Oct 05, 2018 at 16:49:03 +0100, Alex Bennée wrote:
(snip)
> +static int bind_to_tracepoints(GModule *g_module, GPtrArray *events)
> +{
> +    int count = 0;
> +    TraceEventIter iter;
> +    TraceEvent *ev;
> +
> +    trace_event_iter_init(&iter, "*");
> +    while ((ev = trace_event_iter_next(&iter)) != NULL) {
> +        const char *name = trace_event_get_name(ev);
> +        gpointer fn;
> +
> +        if (g_module_symbol(g_module, name, &fn)) {
> +            ev->plugin = (uintptr_t) fn;
> +            trace_event_set_state_dynamic(ev, true);
> +            count++;
> +        }
> +    }

I'd rather have subscription functions exposed to the
plugins via an API, so that
- Plugins can turn on and off subscriptions to callbacks
  as they see fit, instead of "being called from
  the very beginning, and then disable forever"
- We can have compile-time failures when doing something
  wrong with callback names :-)

Thanks,

                E.



reply via email to

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