X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=c26e5163c993f760885a5e1c7916d32b1397f284;hb=9732459c9d6ee49fdc424ecad4cd956922e6ecf0;hp=a6ce344a483d11642bf751aae9fad1565aa46afd;hpb=a969e1019813f1e2354fe57c8393f6268d943414;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index a6ce344a4..c26e5163c 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1409,16 +1409,28 @@ end: return ret; } + +static int cmd_enable_event_internal(struct ltt_session *session, + struct lttng_domain *domain, + char *channel_name, struct lttng_event *event, + char *filter_expression, + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion, + int wpipe); + /* - * Command LTTNG_ENABLE_EVENT processed by the client thread. - * We own filter, exclusion, and filter_expression. + * Internal version of cmd_enable_event() with a supplemental + * "internal_event" flag which is used to enable internal events which should + * be hidden from clients. Such events are used in the agent implementation to + * enable the events through which all "agent" events are funeled. */ -int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, +static int _cmd_enable_event(struct ltt_session *session, + struct lttng_domain *domain, char *channel_name, struct lttng_event *event, char *filter_expression, struct lttng_filter_bytecode *filter, struct lttng_event_exclusion *exclusion, - int wpipe) + int wpipe, bool internal_event) { int ret, channel_created = 0; struct lttng_channel *attr; @@ -1614,7 +1626,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, /* At this point, the session and channel exist on the tracer */ ret = event_ust_enable_tracepoint(usess, uchan, event, - filter_expression, filter, exclusion); + filter_expression, filter, exclusion, + internal_event); /* We have passed ownership */ filter_expression = NULL; filter = NULL; @@ -1697,7 +1710,7 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, + filter->len); } - ret = cmd_enable_event(session, &tmp_dom, + ret = cmd_enable_event_internal(session, &tmp_dom, (char *) default_chan_name, &uevent, filter_expression, filter_copy, NULL, wpipe); @@ -1738,6 +1751,38 @@ error: return ret; } +/* + * Command LTTNG_ENABLE_EVENT processed by the client thread. + * We own filter, exclusion, and filter_expression. + */ +int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, + char *channel_name, struct lttng_event *event, + char *filter_expression, + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion, + int wpipe) +{ + return _cmd_enable_event(session, domain, channel_name, event, + filter_expression, filter, exclusion, wpipe, false); +} + +/* + * Enable an event which is internal to LTTng. An internal should + * never be made visible to clients and are immune to checks such as + * reserved names. + */ +static int cmd_enable_event_internal(struct ltt_session *session, + struct lttng_domain *domain, + char *channel_name, struct lttng_event *event, + char *filter_expression, + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion, + int wpipe) +{ + return _cmd_enable_event(session, domain, channel_name, event, + filter_expression, filter, exclusion, wpipe, true); +} + /* * Command LTTNG_LIST_TRACEPOINTS processed by the client thread. */ @@ -2456,6 +2501,10 @@ ssize_t cmd_list_domains(struct ltt_session *session, if (session->kernel_session != NULL) { (*domains)[index].type = LTTNG_DOMAIN_KERNEL; + + /* Kernel session buffer type is always GLOBAL */ + (*domains)[index].buf_type = LTTNG_BUFFER_GLOBAL; + index++; }