{
if (to_create) {
/* Create event on all UST registered apps for session */
- ret = ust_app_create_event_all(usess, uchan, uevent);
+ ret = ust_app_create_event_glb(usess, uchan, uevent);
} else {
/* Enable event on all UST registered apps for session */
- ret = ust_app_enable_event_all(usess, uchan, uevent);
+ ret = ust_app_enable_event_glb(usess, uchan, uevent);
}
if (ret < 0) {
goto error;
}
- ret = ust_app_disable_channel_all(usess, uchan);
+ ret = ust_app_disable_channel_glb(usess, uchan);
if (ret < 0) {
ret = LTTCOMM_UST_DISABLE_FAIL;
goto error;
DBG2("UST channel %s added to global domain HT", attr->name);
/* Add channel to all registered applications */
- ret = ust_app_create_channel_all(usess, uchan);
+ ret = ust_app_create_channel_glb(usess, uchan);
if (ret != 0) {
ret = LTTCOMM_UST_CHAN_FAIL;
goto error;
goto error;
}
- ret = ust_app_enable_channel_all(usess, uchan);
+ ret = ust_app_enable_channel_glb(usess, uchan);
if (ret < 0) {
ret = LTTCOMM_UST_ENABLE_FAIL;
goto error;
{
struct ltt_ust_session *usess;
struct ltt_ust_channel *uchan;
+ struct ltt_ust_event *uevent;
usess = session->ust_session;
goto error;
}
- ret = ust_app_disable_event(usess, uchan, event_name);
+ uevent = trace_ust_find_event_by_name(uchan->events, event_name);
+ if (uevent == NULL) {
+ ret = LTTCOMM_UST_EVENT_NOT_FOUND;
+ goto error;
+ }
+
+ ret = ust_app_disable_event_glb(usess, uchan, uevent);
if (ret < 0) {
ret = LTTCOMM_UST_DISABLE_FAIL;
goto error;
}
+ uevent->enabled = 0;
+
DBG2("Disable UST event %s in channel %s completed", event_name,
channel_name);
goto error;
}
- ret = ust_app_disable_event_all(usess, uchan);
+ ret = ust_app_disable_all_event_glb(usess, uchan);
if (ret < 0) {
ret = LTTCOMM_UST_DISABLE_FAIL;
goto error;
*/
static
int enable_ust_app_event(struct ust_app_session *ua_sess,
- struct ust_app_channel *ua_chan, struct ust_app_event *ua_event,
- struct ust_app *app)
+ struct ust_app_event *ua_event, struct ust_app *app)
{
int ret;
/*
* For a specific UST session, disable the channel for all registered apps.
*/
-int ust_app_disable_channel_all(struct ltt_ust_session *usess,
+int ust_app_disable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
int ret = 0;
/*
* For a specific UST session, enable the channel for all registered apps.
*/
-int ust_app_enable_channel_all(struct ltt_ust_session *usess,
+int ust_app_enable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
int ret = 0;
/*
* Disable an event in a channel and for a specific session.
*/
-int ust_app_disable_event(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan, char *event_name)
+int ust_app_disable_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{
int ret = 0;
struct cds_lfht_iter iter, uiter;
struct ust_app_event *ua_event;
DBG("UST app disabling event %s for all apps in channel "
- "%s for session uid %d", event_name, uchan->name, usess->uid);
+ "%s for session uid %d", uevent->attr.name, uchan->name, usess->uid);
rcu_read_lock();
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
ua_event_node = hashtable_lookup(ua_chan->events,
- (void *) event_name, strlen(event_name), &uiter);
+ (void *)uevent->attr.name, strlen(uevent->attr.name), &uiter);
if (ua_event_node == NULL) {
DBG2("Event %s not found in channel %s for app pid %d."
- "Skipping", event_name, uchan->name, app->key.pid);
+ "Skipping", uevent->attr.name, uchan->name, app->key.pid);
continue;
}
ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
* For a specific UST session and UST channel, the event for all
* registered apps.
*/
-int ust_app_disable_event_all(struct ltt_ust_session *usess,
+int ust_app_disable_all_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
int ret = 0;
/*
* For a specific UST session, create the channel for all registered apps.
*/
-int ust_app_create_channel_all(struct ltt_ust_session *usess,
+int ust_app_create_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
int ret = 0;
/*
* Enable event for a specific session and channel on the tracer.
*/
-int ust_app_enable_event_all(struct ltt_ust_session *usess,
+int ust_app_enable_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{
int ret = 0;
struct cds_lfht_iter iter, uiter;
- struct cds_lfht_node *ua_chan_node;
+ struct cds_lfht_node *ua_chan_node, *ua_event_node;
struct ust_app *app;
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
- /* Enable each events of channel */
- cds_lfht_for_each_entry(ua_chan->events, &uiter, ua_event, node) {
- ret = enable_ust_app_event(ua_sess, ua_chan, ua_event, app);
- if (ret < 0) {
- /* XXX: Report error someday... */
- continue;
- }
+ ua_event_node = hashtable_lookup(ua_sess->channels,
+ (void*)uevent->attr.name, strlen(uevent->attr.name), &uiter);
+ if (ua_event_node == NULL) {
+ DBG3("UST app enable event %s not found. Skipping app",
+ uevent->attr.name);
+ continue;
+ }
+ ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
+
+ ret = enable_ust_app_event(ua_sess, ua_event, app);
+ if (ret < 0) {
+ /* XXX: Report error someday... */
+ continue;
}
}
* For a specific existing UST session and UST channel, creates the event for
* all registered apps.
*/
-int ust_app_create_event_all(struct ltt_ust_session *usess,
+int ust_app_create_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{
int ret = 0;
int ust_app_register(struct ust_register_msg *msg, int sock);
void ust_app_unregister(int sock);
-int ust_app_create_channel_all(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan);
-int ust_app_create_event_all(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
unsigned long ust_app_list_count(void);
int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app);
int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app);
int ust_app_destroy_trace(struct ltt_ust_session *usess, struct ust_app *app);
int ust_app_destroy_trace_all(struct ltt_ust_session *usess);
int ust_app_list_events(struct lttng_event **events);
-int ust_app_disable_channel_all(struct ltt_ust_session *usess,
+int ust_app_create_channel_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan);
+int ust_app_create_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
+int ust_app_disable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan);
-int ust_app_enable_channel_all(struct ltt_ust_session *usess,
+int ust_app_enable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan);
-int ust_app_enable_event_all(struct ltt_ust_session *usess,
+int ust_app_enable_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
-int ust_app_disable_event_all(struct ltt_ust_session *usess,
+int ust_app_disable_all_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan);
+int ust_app_enable_all_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan);
-int ust_app_disable_event(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan, char *event_name);
+int ust_app_disable_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
void ust_app_global_update(struct ltt_ust_session *usess, int sock);
void ust_app_clean_list(void);
return NULL;
}
static inline
-int ust_app_add_channel_all(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan)
-{
- return 0;
-}
-static inline
-int ust_app_add_event_all(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
-{
- return 0;
-}
-static inline
struct cds_lfht *ust_app_get_ht(void)
{
return NULL;
void ust_app_global_update(struct ltt_ust_session *usess, int sock)
{}
static inline
-int ust_app_disable_channel_all(struct ltt_ust_session *usess,
+int ust_app_disable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
return 0;
}
static inline
-int ust_app_enable_channel_all(struct ltt_ust_session *usess,
+int ust_app_enable_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
return 0;
}
static inline
-int ust_app_disable_event_all(struct ltt_ust_session *usess,
+int ust_app_create_channel_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
return 0;
}
static inline
-int ust_app_disable_event(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan, char *event_name)
+int ust_app_disable_all_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan)
{
return 0;
}
static inline
-int ust_app_create_channel_all(struct ltt_ust_session *usess,
+int ust_app_enable_all_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan)
{
return 0;
}
static inline
-int ust_app_create_event_all(struct ltt_ust_session *usess,
+int ust_app_create_event_glb(struct ltt_ust_session *usess,
+ struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
+{
+ return 0;
+}
+static inline
+int ust_app_disable_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{
return 0;
}
static inline
-int ust_app_enable_event_all(struct ltt_ust_session *usess,
+int ust_app_enable_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{
return 0;