[lttng-dev] [Patch LTTng-tools 2/4] Receive the CTF named enumerations from ust by the session daemon

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Jan 30 20:43:44 EST 2014


----- Original Message -----
> From: "Geneviève Bastien" <gbastien+lttng at versatic.net>
> To: lttng-dev at lists.lttng.org
> Sent: Friday, January 24, 2014 3:07:23 PM
> Subject: [lttng-dev] [Patch LTTng-tools 2/4] Receive the CTF named	enumerations from ust by the session daemon
> 
> The session daemon can receive the named metadata coming with a tracepoint.
> The
> named metadata come after the tracepoint description itself.

Looks generally good, except for the naming (global types ?).

Thanks,

Mathieu

> 
> Signed-off-by: Geneviève Bastien <gbastien+lttng at versatic.net>
> ---
>  src/bin/lttng-sessiond/lttng-ust-ctl.h |  4 +++-
>  src/bin/lttng-sessiond/ust-app.c       | 13 +++++++++----
>  src/bin/lttng-sessiond/ust-registry.c  |  8 +++++---
>  src/bin/lttng-sessiond/ust-registry.h  |  6 +++++-
>  4 files changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/lttng-ust-ctl.h
> b/src/bin/lttng-sessiond/lttng-ust-ctl.h
> index b5acd0f..d229b68 100644
> --- a/src/bin/lttng-sessiond/lttng-ust-ctl.h
> +++ b/src/bin/lttng-sessiond/lttng-ust-ctl.h
> @@ -400,7 +400,9 @@ int ustctl_recv_register_event(int sock,
>  					 */
>  	size_t *nr_fields,
>  	struct ustctl_field **fields,
> -	char **model_emf_uri);
> +	char **model_emf_uri,
> +	size_t *nr_metadata,
> +	struct ustctl_named_metadata **named_metadata);
>  
>  /*
>   * Returns 0 on success, negative error value on error.
> diff --git a/src/bin/lttng-sessiond/ust-app.c
> b/src/bin/lttng-sessiond/ust-app.c
> index 34d4c9b..a27ebe0 100644
> --- a/src/bin/lttng-sessiond/ust-app.c
> +++ b/src/bin/lttng-sessiond/ust-app.c
> @@ -4647,7 +4647,8 @@ error_rcu_unlock:
>   */
>  static int add_event_ust_registry(int sock, int sobjd, int cobjd, char
>  *name,
>  		char *sig, size_t nr_fields, struct ustctl_field *fields, int loglevel,
> -		char *model_emf_uri)
> +		char *model_emf_uri, size_t nr_metadata,
> +		struct ustctl_named_metadata *named_metadata)
>  {
>  	int ret, ret_code;
>  	uint32_t event_id = 0;
> @@ -4704,7 +4705,7 @@ static int add_event_ust_registry(int sock, int sobjd,
> int cobjd, char *name,
>  	ret_code = ust_registry_create_event(registry, chan_reg_key,
>  			sobjd, cobjd, name, sig, nr_fields, fields, loglevel,
>  			model_emf_uri, ua_sess->buffer_type, &event_id,
> -			app);
> +			app, nr_metadata, named_metadata);
>  
>  	/*
>  	 * The return value is returned to ustctl so in case of an error, the
> @@ -4764,11 +4765,14 @@ int ust_app_recv_notify(int sock)
>  		char name[LTTNG_UST_SYM_NAME_LEN], *sig, *model_emf_uri;
>  		size_t nr_fields;
>  		struct ustctl_field *fields;
> +		size_t nr_metadata;
> +		struct ustctl_named_metadata *named_metadata;
>  
>  		DBG2("UST app ustctl register event received");
>  
>  		ret = ustctl_recv_register_event(sock, &sobjd, &cobjd, name, &loglevel,
> -				&sig, &nr_fields, &fields, &model_emf_uri);
> +				&sig, &nr_fields, &fields, &model_emf_uri, &nr_metadata,
> +				&named_metadata);
>  		if (ret < 0) {
>  			if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
>  				ERR("UST app recv event failed with ret %d", ret);
> @@ -4785,7 +4789,8 @@ int ust_app_recv_notify(int sock)
>  		 * to the this function.
>  		 */
>  		ret = add_event_ust_registry(sock, sobjd, cobjd, name, sig, nr_fields,
> -				fields, loglevel, model_emf_uri);
> +				fields, loglevel, model_emf_uri, nr_metadata,
> +				named_metadata);
>  		if (ret < 0) {
>  			goto error;
>  		}
> diff --git a/src/bin/lttng-sessiond/ust-registry.c
> b/src/bin/lttng-sessiond/ust-registry.c
> index dc49416..00e1c26 100644
> --- a/src/bin/lttng-sessiond/ust-registry.c
> +++ b/src/bin/lttng-sessiond/ust-registry.c
> @@ -133,7 +133,7 @@ int validate_event_fields(size_t nr_fields, struct
> ustctl_field *fields,
>  static struct ust_registry_event *alloc_event(int session_objd,
>  		int channel_objd, char *name, char *sig, size_t nr_fields,
>  		struct ustctl_field *fields, int loglevel, char *model_emf_uri,
> -		struct ust_app *app)
> +		struct ust_app *app, size_t nr_metadata, struct ustctl_named_metadata
> *named_metadata)
>  {
>  	struct ust_registry_event *event = NULL;
>  
> @@ -163,6 +163,8 @@ static struct ust_registry_event *alloc_event(int
> session_objd,
>  		strncpy(event->name, name, sizeof(event->name));
>  		event->name[sizeof(event->name) - 1] = '\0';
>  	}
> +	event->nr_metadata = nr_metadata;
> +	event->named_metadata = named_metadata;
>  	cds_lfht_node_init(&event->node.node);
>  
>  error:
> @@ -249,7 +251,7 @@ int ust_registry_create_event(struct ust_registry_session
> *session,
>  		uint64_t chan_key, int session_objd, int channel_objd, char *name,
>  		char *sig, size_t nr_fields, struct ustctl_field *fields, int loglevel,
>  		char *model_emf_uri, int buffer_type, uint32_t *event_id_p,
> -		struct ust_app *app)
> +		struct ust_app *app, size_t nr_metadata, struct ustctl_named_metadata
> *named_metadata)
>  {
>  	int ret;
>  	uint32_t event_id;
> @@ -286,7 +288,7 @@ int ust_registry_create_event(struct ust_registry_session
> *session,
>  	}
>  
>  	event = alloc_event(session_objd, channel_objd, name, sig, nr_fields,
> -			fields, loglevel, model_emf_uri, app);
> +			fields, loglevel, model_emf_uri, app, nr_metadata, named_metadata);
>  	if (!event) {
>  		ret = -ENOMEM;
>  		goto error_free;
> diff --git a/src/bin/lttng-sessiond/ust-registry.h
> b/src/bin/lttng-sessiond/ust-registry.h
> index f195b74..183db0f 100644
> --- a/src/bin/lttng-sessiond/ust-registry.h
> +++ b/src/bin/lttng-sessiond/ust-registry.h
> @@ -137,6 +137,9 @@ struct ust_registry_event {
>  	 * initialize the node and the event_name/signature for the match function.
>  	 */
>  	struct lttng_ht_node_u64 node;
> +	/* Named metadata needed by the event */
> +	struct ustctl_named_metadata *named_metadata;
> +	size_t nr_metadata;
>  };
>  
>  /*
> @@ -226,7 +229,8 @@ int ust_registry_create_event(struct ust_registry_session
> *session,
>  		uint64_t chan_key, int session_objd, int channel_objd, char *name,
>  		char *sig, size_t nr_fields, struct ustctl_field *fields, int loglevel,
>  		char *model_emf_uri, int buffer_type, uint32_t *event_id_p,
> -		struct ust_app *app);
> +		struct ust_app *app,
> +		size_t nr_metadata, struct ustctl_named_metadata *named_metadata);
>  struct ust_registry_event *ust_registry_find_event(
>  		struct ust_registry_channel *chan, char *name, char *sig);
>  void ust_registry_destroy_event(struct ust_registry_channel *chan,
> --
> 1.8.5.3
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list