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;
/* 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;
+ 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);
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.
*/
/* Create ust event */
uevent = trace_ust_create_event(&events[i], filter_expression,
- filter, NULL);
+ filter, NULL, false);
if (uevent == NULL) {
ret = LTTNG_ERR_FATAL;
goto error_destroy;
struct ltt_ust_channel *uchan, struct lttng_event *event,
char *filter_expression,
struct lttng_filter_bytecode *filter,
- struct lttng_event_exclusion *exclusion)
+ struct lttng_event_exclusion *exclusion,
+ bool internal_event)
{
int ret = LTTNG_OK, to_create = 0;
struct ltt_ust_event *uevent;
event->loglevel, exclusion);
if (uevent == NULL) {
uevent = trace_ust_create_event(event, filter_expression,
- filter, exclusion);
+ filter, exclusion, internal_event);
/* We have passed ownership */
filter_expression = NULL;
filter = NULL;
char *filter_expression;
struct lttng_ust_filter_bytecode *filter;
struct lttng_event_exclusion *exclusion;
+ bool internal;
};
/* UST channel */
struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
char *filter_expression,
struct lttng_filter_bytecode *filter,
- struct lttng_event_exclusion *exclusion);
+ struct lttng_event_exclusion *exclusion,
+ bool internal_event);
struct ltt_ust_context *trace_ust_create_context(
struct lttng_event_context *ctx);
int trace_ust_match_context(struct ltt_ust_context *uctx,
struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
const char *filter_expression,
struct lttng_filter_bytecode *filter,
- struct lttng_event_exclusion *exclusion)
+ struct lttng_event_exclusion *exclusion,
+ bool internal_event)
{
return NULL;
}
ev.type = LTTNG_EVENT_TRACEPOINT;
ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
- event = trace_ust_create_event(&ev, NULL, NULL, NULL);
+ event = trace_ust_create_event(&ev, NULL, NULL, NULL, false);
ok(event != NULL, "Create UST event");
exclusion->count = 1;
strncpy((char *)(exclusion->names), get_random_string(), LTTNG_SYMBOL_NAME_LEN);
- event = trace_ust_create_event(&ev, NULL, NULL, exclusion);
+ event = trace_ust_create_event(&ev, NULL, NULL, exclusion, false);
ok(event != NULL, "Create UST event with exclusion");