projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port: Add Solaris support to socket compat
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
ust-app.c
diff --git
a/src/bin/lttng-sessiond/ust-app.c
b/src/bin/lttng-sessiond/ust-app.c
index c4d9fb5a40c6b14a73bac79014396a8710599ede..bbba4a604e4b5d120840496bb4c7f3a4d625a25d 100644
(file)
--- a/
src/bin/lttng-sessiond/ust-app.c
+++ b/
src/bin/lttng-sessiond/ust-app.c
@@
-101,12
+101,14
@@
static int ht_match_ust_app_event(struct cds_lfht_node *node, const void *_key)
{
struct ust_app_event *event;
const struct ust_app_ht_key *key;
{
struct ust_app_event *event;
const struct ust_app_ht_key *key;
+ int ev_loglevel_value;
assert(node);
assert(_key);
event = caa_container_of(node, struct ust_app_event, node.node);
key = _key;
assert(node);
assert(_key);
event = caa_container_of(node, struct ust_app_event, node.node);
key = _key;
+ ev_loglevel_value = event->attr.loglevel;
/* Match the 4 elements of the key: name, filter, loglevel, exclusions */
/* Match the 4 elements of the key: name, filter, loglevel, exclusions */
@@
-116,9
+118,10
@@
static int ht_match_ust_app_event(struct cds_lfht_node *node, const void *_key)
}
/* Event loglevel. */
}
/* Event loglevel. */
- if (ev
ent->attr.loglevel != key->loglevel
) {
+ if (ev
_loglevel_value != key->loglevel_type
) {
if (event->attr.loglevel_type == LTTNG_UST_LOGLEVEL_ALL
if (event->attr.loglevel_type == LTTNG_UST_LOGLEVEL_ALL
- && key->loglevel == 0 && event->attr.loglevel == -1) {
+ && key->loglevel_type == 0 &&
+ ev_loglevel_value == -1) {
/*
* Match is accepted. This is because on event creation, the
* loglevel is set to -1 if the event loglevel type is ALL so 0 and
/*
* Match is accepted. This is because on event creation, the
* loglevel is set to -1 if the event loglevel type is ALL so 0 and
@@
-184,7
+187,7
@@
static void add_unique_ust_app_event(struct ust_app_channel *ua_chan,
ht = ua_chan->events;
key.name = event->attr.name;
key.filter = event->filter;
ht = ua_chan->events;
key.name = event->attr.name;
key.filter = event->filter;
- key.loglevel = event->attr.loglevel;
+ key.loglevel
_type
= event->attr.loglevel;
key.exclusion = event->exclusion;
node_ptr = cds_lfht_add_unique(ht->ht,
key.exclusion = event->exclusion;
node_ptr = cds_lfht_add_unique(ht->ht,
@@
-1149,7
+1152,8
@@
error:
* Return an ust_app_event object or NULL on error.
*/
static struct ust_app_event *find_ust_app_event(struct lttng_ht *ht,
* Return an ust_app_event object or NULL on error.
*/
static struct ust_app_event *find_ust_app_event(struct lttng_ht *ht,
- char *name, struct lttng_filter_bytecode *filter, int loglevel,
+ char *name, struct lttng_filter_bytecode *filter,
+ int loglevel_value,
const struct lttng_event_exclusion *exclusion)
{
struct lttng_ht_iter iter;
const struct lttng_event_exclusion *exclusion)
{
struct lttng_ht_iter iter;
@@
-1163,7
+1167,7
@@
static struct ust_app_event *find_ust_app_event(struct lttng_ht *ht,
/* Setup key for event lookup. */
key.name = name;
key.filter = filter;
/* Setup key for event lookup. */
key.name = name;
key.filter = filter;
- key.loglevel
= loglevel
;
+ key.loglevel
_type = loglevel_value
;
/* lttng_event_exclusion and lttng_ust_event_exclusion structures are similar */
key.exclusion = exclusion;
/* lttng_event_exclusion and lttng_ust_event_exclusion structures are similar */
key.exclusion = exclusion;
@@
-3478,7
+3482,9
@@
int ust_app_list_events(struct lttng_event **events)
}
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
}
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
@@
-3503,7
+3509,9
@@
int ust_app_list_events(struct lttng_event **events)
free(tmp_event);
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
free(tmp_event);
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
@@
-3524,7
+3532,7
@@
int ust_app_list_events(struct lttng_event **events)
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
+ if (ret
< 0 && ret
!= -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
@@
-3606,7
+3614,9
@@
int ust_app_list_event_fields(struct lttng_event_field **fields)
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
@@
-3631,7
+3641,9
@@
int ust_app_list_event_fields(struct lttng_event_field **fields)
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
@@
-3657,7
+3669,9
@@
int ust_app_list_event_fields(struct lttng_event_field **fields)
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
+ if (ret < 0 &&
+ ret != -LTTNG_UST_ERR_EXITING &&
+ ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
@@
-3869,7
+3883,7
@@
int ust_app_disable_event_glb(struct ltt_ust_session *usess,
{
int ret = 0;
struct lttng_ht_iter iter, uiter;
{
int ret = 0;
struct lttng_ht_iter iter, uiter;
- struct lttng_ht_node_str *ua_chan_node
, *ua_event_node
;
+ struct lttng_ht_node_str *ua_chan_node;
struct ust_app *app;
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
struct ust_app *app;
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
@@
-3906,14
+3920,14
@@
int ust_app_disable_event_glb(struct ltt_ust_session *usess,
}
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
}
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
- lttng_ht_lookup(ua_chan->events, (void *)uevent->attr.name, &uiter);
- ua_event_node = lttng_ht_iter_get_node_str(&uiter);
- if (ua_event_node == NULL) {
+ ua_event = find_ust_app_event(ua_chan->events, uevent->attr.name,
+ uevent->filter, uevent->attr.loglevel,
+ uevent->exclusion);
+ if (ua_event == NULL) {
DBG2("Event %s not found in channel %s for app pid %d."
"Skipping", uevent->attr.name, uchan->name, app->pid);
continue;
}
DBG2("Event %s not found in channel %s for app pid %d."
"Skipping", uevent->attr.name, uchan->name, app->pid);
continue;
}
- ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
ret = disable_ust_app_event(ua_sess, ua_event, app);
if (ret < 0) {
ret = disable_ust_app_event(ua_sess, ua_event, app);
if (ret < 0) {
@@
-5173,8
+5187,8
@@
error_rcu_unlock:
* On success 0 is returned else a negative value.
*/
static int add_event_ust_registry(int sock, int sobjd, int cobjd, char *name,
* On success 0 is returned else a negative value.
*/
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 *sig, size_t nr_fields, struct ustctl_field *fields,
+
int loglevel_value,
char *model_emf_uri)
{
int ret, ret_code;
uint32_t event_id = 0;
{
int ret, ret_code;
uint32_t event_id = 0;
@@
-5229,9
+5243,9
@@
static int add_event_ust_registry(int sock, int sobjd, int cobjd, char *name,
* three variables MUST NOT be read/write after this.
*/
ret_code = ust_registry_create_event(registry, chan_reg_key,
* three variables MUST NOT be read/write after this.
*/
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);
+ sobjd, cobjd, name, sig, nr_fields, fields,
+
loglevel_value, model_emf_uri, ua_sess->buffer_type
,
+
&event_id,
app);
/*
* The return value is returned to ustctl so in case of an error, the
/*
* The return value is returned to ustctl so in case of an error, the
@@
-5287,15
+5301,16
@@
int ust_app_recv_notify(int sock)
switch (cmd) {
case USTCTL_NOTIFY_CMD_EVENT:
{
switch (cmd) {
case USTCTL_NOTIFY_CMD_EVENT:
{
- int sobjd, cobjd, loglevel;
+ int sobjd, cobjd, loglevel
_value
;
char name[LTTNG_UST_SYM_NAME_LEN], *sig, *model_emf_uri;
size_t nr_fields;
struct ustctl_field *fields;
DBG2("UST app ustctl register event received");
char name[LTTNG_UST_SYM_NAME_LEN], *sig, *model_emf_uri;
size_t nr_fields;
struct ustctl_field *fields;
DBG2("UST app ustctl register event received");
- ret = ustctl_recv_register_event(sock, &sobjd, &cobjd, name, &loglevel,
- &sig, &nr_fields, &fields, &model_emf_uri);
+ ret = ustctl_recv_register_event(sock, &sobjd, &cobjd, name,
+ &loglevel_value, &sig, &nr_fields, &fields,
+ &model_emf_uri);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app recv event failed with ret %d", ret);
if (ret < 0) {
if (ret != -EPIPE && ret != -LTTNG_UST_ERR_EXITING) {
ERR("UST app recv event failed with ret %d", ret);
@@
-5312,7
+5327,7
@@
int ust_app_recv_notify(int sock)
* to the this function.
*/
ret = add_event_ust_registry(sock, sobjd, cobjd, name, sig, nr_fields,
* to the this function.
*/
ret = add_event_ust_registry(sock, sobjd, cobjd, name, sig, nr_fields,
- fields, loglevel, model_emf_uri);
+ fields, loglevel
_value
, model_emf_uri);
if (ret < 0) {
goto error;
}
if (ret < 0) {
goto error;
}
This page took
0.0287 seconds
and
4
git commands to generate.