diff mbox series

[RFC,11/21] trace: expose a plugin fn pointer in TraceEvent

Message ID 20181005154910.3099-12-alex.bennee@linaro.org
State New
Headers show
Series Trace updates and plugin RFC | expand

Commit Message

Alex Bennée Oct. 5, 2018, 3:49 p.m. UTC
We'll need somewhere to stash this later. It's up to the generated
code to do the funky casting to what it really is.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 trace/control-internal.h | 6 ++++++
 trace/event-internal.h   | 3 +++
 2 files changed, 9 insertions(+)

-- 
2.17.1

Comments

Richard Henderson Oct. 15, 2018, 4:52 p.m. UTC | #1
On 10/5/18 8:49 AM, Alex Bennée wrote:
> We'll need somewhere to stash this later. It's up to the generated

> code to do the funky casting to what it really is.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  trace/control-internal.h | 6 ++++++

>  trace/event-internal.h   | 3 +++

>  2 files changed, 9 insertions(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/trace/control-internal.h b/trace/control-internal.h
index c7fbe2d3bf..d734576948 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -80,6 +80,12 @@  static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu,
     return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id);
 }
 
+#ifdef CONFIG_TRACE_PLUGIN
+static inline uintptr_t trace_event_get_plugin(TraceEvent *ev)
+{
+    return ev->plugin;
+}
+#endif
 
 void trace_event_register_group(TraceEvent **events);
 
diff --git a/trace/event-internal.h b/trace/event-internal.h
index 8ab3a29941..3895ee9883 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -38,6 +38,9 @@  typedef struct TraceEvent {
     const bool sstate;
     uint16_t *dstate;
     uint64_t count;
+#ifdef CONFIG_TRACE_PLUGIN
+    uintptr_t plugin;
+#endif
 } TraceEvent;
 
 void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state);