Move 'struct lttng_enabler' to private headers
[lttng-ust.git] / liblttng-ust / ust-events-internal.h
index bd30e00a258b48b4901d80463ab8fb44a9164d36..1305a61f6c5925c1b654995771a4f09901b74e90 100644 (file)
 #include <ust-helper.h>
 #include <lttng/ust-events.h>
 
+enum lttng_enabler_format_type {
+       LTTNG_ENABLER_FORMAT_STAR_GLOB,
+       LTTNG_ENABLER_FORMAT_EVENT,
+};
+
+/*
+ * Enabler field, within whatever object is enabling an event. Target of
+ * backward reference.
+ */
+struct lttng_enabler {
+       enum lttng_enabler_format_type format_type;
+
+       /* head list of struct lttng_ust_filter_bytecode_node */
+       struct cds_list_head filter_bytecode_head;
+       /* head list of struct lttng_ust_excluder_node */
+       struct cds_list_head excluder_head;
+
+       struct lttng_ust_event event_param;
+       unsigned int enabled:1;
+};
+
 struct lttng_event_enabler {
        struct lttng_enabler base;
        struct cds_list_head node;      /* per-session list of enablers */
@@ -242,4 +263,37 @@ struct lttng_counter *lttng_ust_counter_create(
                const char *counter_transport_name,
                size_t number_dimensions, const struct lttng_counter_dimension *dimensions);
 
+#ifdef HAVE_PERF_EVENT
+
+LTTNG_HIDDEN
+int lttng_add_perf_counter_to_ctx(uint32_t type,
+                                 uint64_t config,
+                                 const char *name,
+                                 struct lttng_ctx **ctx);
+LTTNG_HIDDEN
+int lttng_perf_counter_init(void);
+LTTNG_HIDDEN
+void lttng_perf_counter_exit(void);
+
+#else /* #ifdef HAVE_PERF_EVENT */
+
+static inline
+int lttng_add_perf_counter_to_ctx(uint32_t type,
+                                 uint64_t config,
+                                 const char *name,
+                                 struct lttng_ctx **ctx)
+{
+       return -ENOSYS;
+}
+static inline
+int lttng_perf_counter_init(void)
+{
+       return 0;
+}
+static inline
+void lttng_perf_counter_exit(void)
+{
+}
+#endif /* #else #ifdef HAVE_PERF_EVENT */
+
 #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */
This page took 0.024039 seconds and 4 git commands to generate.