const char *name;
const struct lttng_bytecode *filter;
enum lttng_ust_abi_loglevel_type loglevel_type;
+ int loglevel_value;
const struct lttng_event_exclusion *exclusion;
};
* and a linked list is kept of all running traceable app.
*/
struct ust_app {
+ /*
+ * The lifetime of 'sock' holds a reference to the application; the
+ * application management thread will release a reference to the
+ * application if the application dies.
+ */
+ urcu_ref ref;
+
/* Traffic initiated from the session daemon to the application. */
int sock;
pthread_mutex_t sock_lock; /* Protects sock protocol. */
int ust_app_register(struct ust_register_msg *msg, int sock);
int ust_app_register_done(struct ust_app *app);
int ust_app_version(struct ust_app *app);
-void ust_app_unregister(int sock);
+void ust_app_unregister_by_socket(int sock);
int ust_app_start_trace_all(struct ltt_ust_session *usess);
int ust_app_stop_trace_all(struct ltt_ust_session *usess);
int ust_app_destroy_trace_all(struct ltt_ust_session *usess);
ssize_t ust_app_push_metadata(const lttng::sessiond::ust::registry_session::locked_ptr& registry,
struct consumer_socket *socket,
int send_zero_data);
-void ust_app_destroy(struct ust_app *app);
enum lttng_error_code ust_app_snapshot_record(const struct ltt_ust_session *usess,
const struct consumer_output *output,
uint64_t nb_packets_per_stream);
bool ust_app_supports_notifiers(const struct ust_app *app);
bool ust_app_supports_counters(const struct ust_app *app);
+bool ust_app_get(ust_app& app);
+void ust_app_put(ust_app *app);
+
+using ust_app_reference =
+ std::unique_ptr<ust_app, lttng::memory::create_deleter_class<ust_app, ust_app_put>::deleter>;
+
#else /* HAVE_LIBLTTNG_UST_CTL */
static inline int ust_app_destroy_trace_all(struct ltt_ust_session *usess __attribute__((unused)))
return -ENOSYS;
}
-static inline void ust_app_unregister(int sock __attribute__((unused)))
+static inline void ust_app_unregister_by_socket(int sock __attribute__((unused)))
{
}
return 0;
}
-static inline void ust_app_destroy(struct ust_app *app __attribute__((unused)))
-{
- return;
-}
-
static inline enum lttng_error_code
ust_app_snapshot_record(struct ltt_ust_session *usess __attribute__((unused)),
const struct consumer_output *output __attribute__((unused)),
return LTTNG_ERR_UNK;
}
+static inline void ust_app_get(ust_app& app __attribute__((unused)))
+{
+}
+
+static inline void ust_app_put(ust_app *app __attribute__((unused)))
+{
+}
+
#endif /* HAVE_LIBLTTNG_UST_CTL */
#endif /* _LTT_UST_APP_H */