+/*
+ * sizeof(#_provider) - 1 : length of the provider string (excluding \0).
+ * sizeof(#_name) - 1 : length of the name string (excluding \0).
+ * + 1 : separator between provider and event name.
+ *
+ * Upper bound (inclusive) is LTTNG_UST_TRACEPOINT_NAME_LEN_MAX - 1 to
+ * account for \0.
+ *
+ * The comparison is:
+ * left hand side: sizeof(#_provider) - 1 + sizeof(#_name) - 1 + 1
+ * right hand side: LTTNG_UST_TRACEPOINT_NAME_LEN_MAX - 1
+ * operator: <= (inclusive)
+ * Simplified in the code below.
+ */
+#define lttng_ust_tracepoint_validate_name_len(_provider, _name) \
+ lttng_ust_static_assert(sizeof(#_provider) + sizeof(#_name) <= LTTNG_UST_TRACEPOINT_NAME_LEN_MAX, \
+ "Tracepoint name length is too long", \
+ Tracepoint_name_length_is_too_long)
+