X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust%2Fust-events-internal.h;h=1305a61f6c5925c1b654995771a4f09901b74e90;hb=8665f6a432525473b9dcba296394e68a8f49d9f2;hp=bd30e00a258b48b4901d80463ab8fb44a9164d36;hpb=864a1eda22ed99266509ac76451c6f27f91aa17e;p=lttng-ust.git diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index bd30e00a..1305a61f 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -15,6 +15,27 @@ #include #include +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 */