X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=50ff1632fb1bc3439e3517cdd66cc5129ed85146;hp=30cfc21c4f07fc5f90d637d260a8cbe3740b5a41;hb=88f06f1562c6ecd3a5666baa93a57273fbe10437;hpb=1a29cff2973695e90fa1688b15760c8e98863d6b diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 30cfc21c4..50ff1632f 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1415,16 +1415,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; @@ -1620,7 +1632,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; @@ -1703,7 +1716,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); @@ -1744,6 +1757,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. */