LTTNG_ERR_INVALID_CHANNEL_NAME = 113, /* Invalid channel name */
LTTNG_ERR_PID_TRACKED = 114, /* PID already tracked */
LTTNG_ERR_PID_NOT_TRACKED = 115, /* PID not tracked */
+ LTTNG_ERR_INVALID_CHANNEL_DOMAIN = 116, /* Invalid channel domain */
/* MUST be last element */
LTTNG_ERR_NR, /* Last element */
assert(uchan);
}
+ if (uchan->domain != LTTNG_DOMAIN_UST && !internal_event) {
+ /*
+ * Don't allow users to add UST events to channels which
+ * are assigned to a userspace subdomain (JUL, Log4J,
+ * Python, etc.).
+ */
+ ret = LTTNG_ERR_INVALID_CHANNEL_DOMAIN;
+ goto error;
+ }
+
if (!internal_event) {
/*
* Ensure the event name is not reserved for internal
[ ERROR_INDEX(LTTNG_ERR_INVALID_CHANNEL_NAME) ] = "Invalid channel name",
[ ERROR_INDEX(LTTNG_ERR_PID_TRACKED) ] = "PID already tracked",
[ ERROR_INDEX(LTTNG_ERR_PID_NOT_TRACKED) ] = "PID not tracked",
+ [ ERROR_INDEX(LTTNG_ERR_INVALID_CHANNEL_DOMAIN) ] = "Invalid channel domain",
/* Last element */
[ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"