X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.h;h=3972088a4cbde6415db658deb2f4c7fefd741884;hb=3faa1e3d9bb6b6cd1fa370c206614af9061815be;hp=568bd09e478048af0720cd5e877fe1f478d8ee7d;hpb=95671f5349e87cdd2ea6cb47243608e9368ab8d5;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 568bd09e4..3972088a4 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -10,6 +10,7 @@ #define _LTT_UST_APP_H #include +#include #include #include @@ -249,6 +250,12 @@ struct ust_app_session { * 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. + */ + struct urcu_ref ref; int sock; pthread_mutex_t sock_lock; /* Protects sock protocol. */ @@ -338,7 +345,7 @@ struct ust_app { 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); @@ -372,7 +379,6 @@ struct ust_app *ust_app_create(struct ust_register_msg *msg, int sock); void ust_app_notify_sock_unregister(int sock); ssize_t ust_app_push_metadata(struct ust_registry_session *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, int wait, @@ -408,6 +414,9 @@ int ust_app_supported(void) bool ust_app_supports_notifiers(const struct ust_app *app); bool ust_app_supports_counters(const struct ust_app *app); +bool ust_app_get(struct ust_app *app); +void ust_app_put(struct ust_app *app); + #else /* HAVE_LIBLTTNG_UST_CTL */ static inline @@ -456,7 +465,7 @@ int ust_app_version(struct ust_app *app) return -ENOSYS; } static inline -void ust_app_unregister(int sock) +void ust_app_unregister_by_socket(int sock) { } static inline @@ -573,11 +582,6 @@ ssize_t ust_app_push_metadata(struct ust_registry_session *registry, return 0; } static inline -void ust_app_destroy(struct ust_app *app) -{ - return; -} -static inline enum lttng_error_code ust_app_snapshot_record(struct ltt_ust_session *usess, const struct consumer_output *output, int wait, uint64_t max_stream_size) { @@ -679,6 +683,16 @@ enum lttng_error_code ust_app_open_packets(struct ltt_session *session) return 0; } +static inline +void ust_app_get(struct ust_app *app) +{ +} + +static inline +void ust_app_put(struct ust_app *app) +{ +} + #endif /* HAVE_LIBLTTNG_UST_CTL */ #endif /* _LTT_UST_APP_H */