projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port: Remove _GNU_SOURCE, defined in config.h
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index dfc8b31d0848ef2366ec5b66ef88b03b32ef31c9..33e301c87fb20850d536e5637b3ddb7a4420b0c7 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-15,10
+15,8
@@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#define _LGPL_SOURCE
#include <assert.h>
-#include <string.h>
#include <inttypes.h>
#include <urcu/list.h>
#include <urcu/uatomic.h>
#include <inttypes.h>
#include <urcu/list.h>
#include <urcu/uatomic.h>
@@
-28,6
+26,7
@@
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/relayd/relayd.h>
#include <common/utils.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/relayd/relayd.h>
#include <common/utils.h>
+#include <common/compat/string.h>
#include "channel.h"
#include "consumer.h"
#include "channel.h"
#include "consumer.h"
@@
-1048,7
+1047,7
@@
int cmd_enable_channel(struct ltt_session *session,
assert(attr);
assert(domain);
assert(attr);
assert(domain);
- len = strnlen(attr->name, sizeof(attr->name));
+ len =
lttng_
strnlen(attr->name, sizeof(attr->name));
/* Validate channel name */
if (attr->name[0] == '.' ||
/* Validate channel name */
if (attr->name[0] == '.' ||
@@
-1225,28
+1224,18
@@
int cmd_disable_event(struct ltt_session *session,
switch (event->type) {
case LTTNG_EVENT_ALL:
switch (event->type) {
case LTTNG_EVENT_ALL:
- ret = event_kernel_disable_event_all(kchan);
- if (ret != LTTNG_OK) {
- goto error_unlock;
- }
- break;
- case LTTNG_EVENT_TRACEPOINT: /* fall-through */
+ case LTTNG_EVENT_TRACEPOINT:
case LTTNG_EVENT_SYSCALL:
case LTTNG_EVENT_SYSCALL:
- if (!strcmp(event_name, "*")) {
- ret = event_kernel_disable_event_type(kchan,
- event->type);
+ case LTTNG_EVENT_PROBE:
+ case LTTNG_EVENT_FUNCTION:
+ case LTTNG_EVENT_FUNCTION_ENTRY:/* fall-through */
+ if (event_name[0] == '\0') {
+ ret = event_kernel_disable_event(kchan,
+ NULL, event->type);
} else {
ret = event_kernel_disable_event(kchan,
} else {
ret = event_kernel_disable_event(kchan,
- event_name);
- }
- if (ret != LTTNG_OK) {
- goto error_unlock;
+ event_name, event->type);
}
}
- break;
- case LTTNG_EVENT_PROBE:
- case LTTNG_EVENT_FUNCTION:
- case LTTNG_EVENT_FUNCTION_ENTRY:
- ret = event_kernel_disable_event(kchan, event_name);
if (ret != LTTNG_OK) {
goto error_unlock;
}
if (ret != LTTNG_OK) {
goto error_unlock;
}
@@
-1273,7
+1262,7
@@
int cmd_disable_event(struct ltt_session *session,
/*
* If a non-default channel has been created in the
/*
* If a non-default channel has been created in the
- * session, explicit
e
ly require that -c chan_name needs
+ * session, explicitly require that -c chan_name needs
* to be provided.
*/
if (usess->has_non_default_channel && channel_name[0] == '\0') {
* to be provided.
*/
if (usess->has_non_default_channel && channel_name[0] == '\0') {
@@
-1290,7
+1279,16
@@
int cmd_disable_event(struct ltt_session *session,
switch (event->type) {
case LTTNG_EVENT_ALL:
switch (event->type) {
case LTTNG_EVENT_ALL:
- ret = event_ust_disable_tracepoint(usess, uchan, event_name);
+ /*
+ * An empty event name means that everything
+ * should be disabled.
+ */
+ if (event->name[0] == '\0') {
+ ret = event_ust_disable_all_tracepoints(usess, uchan);
+ } else {
+ ret = event_ust_disable_tracepoint(usess, uchan,
+ event_name);
+ }
if (ret != LTTNG_OK) {
goto error_unlock;
}
if (ret != LTTNG_OK) {
goto error_unlock;
}
@@
-1326,8
+1324,11
@@
int cmd_disable_event(struct ltt_session *session,
ret = -LTTNG_ERR_UST_EVENT_NOT_FOUND;
goto error_unlock;
}
ret = -LTTNG_ERR_UST_EVENT_NOT_FOUND;
goto error_unlock;
}
- /* The wild card * means that everything should be disabled. */
- if (strncmp(event->name, "*", 1) == 0 && strlen(event->name) == 1) {
+ /*
+ * An empty event name means that everything
+ * should be disabled.
+ */
+ if (event->name[0] == '\0') {
ret = event_agent_disable_all(usess, agt);
} else {
ret = event_agent_disable(usess, agt, event_name);
ret = event_agent_disable_all(usess, agt);
} else {
ret = event_agent_disable(usess, agt, event_name);
@@
-2757,7
+2758,11
@@
ssize_t cmd_list_events(enum lttng_domain_type domain,
rcu_read_lock();
cds_lfht_for_each_entry(session->ust_session->agents->ht,
&iter.iter, agt, node.node) {
rcu_read_lock();
cds_lfht_for_each_entry(session->ust_session->agents->ht,
&iter.iter, agt, node.node) {
- nb_event = list_lttng_agent_events(agt, events);
+ if (agt->domain == domain) {
+ nb_event = list_lttng_agent_events(
+ agt, events);
+ break;
+ }
}
rcu_read_unlock();
}
}
rcu_read_unlock();
}
This page took
0.02592 seconds
and
4
git commands to generate.