From: gbastien+lttng@versatic.net (Geneviève Bastien)
Subject: [lttng-dev] [Patch LTTng-tools v2 2/5] Receive the CTF global enumerations from ust by the session daemon
Date: Tue, 11 Feb 2014 16:40:49 -0500 [thread overview]
Message-ID: <1392154852-31268-3-git-send-email-gbastien+lttng@versatic.net> (raw)
In-Reply-To: <1392154852-31268-1-git-send-email-gbastien+lttng@versatic.net>
The session daemon can receive the global type declarations coming with a
tracepoint. The global type declarations come after the tracepoint description
itself.
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 | 10 +++++++---
src/bin/lttng-sessiond/ust-registry.h | 6 +++++-
4 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/src/bin/lttng-sessiond/lttng-ust-ctl.h b/src/bin/lttng-sessiond/lttng-ust-ctl.h
index 41ed6c5..f52640d 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_global_type_decl, /* global type declarations */
+ struct ustctl_global_type_decl **global_type_decl);
/*
* 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..e8015a1 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_global_type_decl,
+ struct ustctl_global_type_decl *global_type_decl)
{
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_global_type_decl, global_type_decl);
/*
* 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_global_type_decl;
+ struct ustctl_global_type_decl *global_type_decl;
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_global_type_decl, &global_type_decl);
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_global_type_decl, global_type_decl);
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..281ea7c 100644
--- a/src/bin/lttng-sessiond/ust-registry.c
+++ b/src/bin/lttng-sessiond/ust-registry.c
@@ -133,7 +133,8 @@ 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_global_type_decl,
+ struct ustctl_global_type_decl *global_type_decl)
{
struct ust_registry_event *event = NULL;
@@ -163,6 +164,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_global_type_decl = nr_global_type_decl;
+ event->global_type_decl = global_type_decl;
cds_lfht_node_init(&event->node.node);
error:
@@ -249,7 +252,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_global_type_decl,
+ struct ustctl_global_type_decl *global_type_decl)
{
int ret;
uint32_t event_id;
@@ -286,7 +290,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_global_type_decl, global_type_decl);
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..8b41c2a 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;
+ /* Global type declarations needed by the event */
+ struct ustctl_global_type_decl *global_type_decl;
+ size_t nr_global_type_decl;
};
/*
@@ -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_global_type_decl,
+ struct ustctl_global_type_decl *global_type_decl);
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.4
next prev parent reply other threads:[~2014-02-11 21:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1390594045-7556-1-git-send-email-gbastien+lttng@versatic.net>
2014-02-11 21:40 ` [lttng-dev] LTTng-tools: Add support of global types and CTF enumerations Geneviève Bastien
2014-02-11 21:40 ` [lttng-dev] [Patch LTTng-tools v2 1/5] Update data structures to support CTF global type declarations Geneviève Bastien
2014-02-11 21:40 ` Geneviève Bastien [this message]
2014-02-11 21:40 ` [lttng-dev] [Patch LTTng-tools v2 3/5] Statedump the metadata for CTF global enumerations Geneviève Bastien
2014-02-11 21:40 ` [lttng-dev] [Patch LTTng-tools v2 4/5] Dump a global type only once per session Geneviève Bastien
2014-02-11 21:40 ` [lttng-dev] [Patch LTTng-tools v2 5/5] Regression tests for global type declarations in UST Geneviève Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392154852-31268-3-git-send-email-gbastien+lttng@versatic.net \
--to=gbastien+lttng@versatic.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox