* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <stdio.h>
#include <urcu/list.h>
int loglevel = 0;
unsigned int has_loglevel = 0;
- assert(enabler->type == LTTNG_ENABLER_STAR_GLOB);
+ assert(enabler->format_type == LTTNG_ENABLER_FORMAT_STAR_GLOB);
if (!strutils_star_glob_match(enabler->event_param.name, SIZE_MAX,
desc->name, SIZE_MAX))
return 0;
int loglevel = 0;
unsigned int has_loglevel = 0;
- assert(enabler->type == LTTNG_ENABLER_EVENT);
+ assert(enabler->format_type == LTTNG_ENABLER_FORMAT_EVENT);
if (strcmp(desc->name, enabler->event_param.name))
return 0;
if (desc->loglevel) {
int lttng_desc_match_enabler(const struct lttng_event_desc *desc,
struct lttng_enabler *enabler)
{
- switch (enabler->type) {
- case LTTNG_ENABLER_STAR_GLOB:
+ switch (enabler->format_type) {
+ case LTTNG_ENABLER_FORMAT_STAR_GLOB:
{
struct lttng_ust_excluder_node *excluder;
}
return 1;
}
- case LTTNG_ENABLER_EVENT:
+ case LTTNG_ENABLER_FORMAT_EVENT:
return lttng_desc_match_event_enabler(desc, enabler);
default:
return -EINVAL;
struct lttng_session *session = enabler->chan->session;
struct lttng_event *event;
+ if (!enabler->enabled)
+ goto end;
+
/* First ensure that probe events are created for this enabler. */
lttng_create_event_if_missing(enabler);
/* TODO: merge event context. */
}
+end:
return 0;
}
/*
* Enabler management.
*/
-struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_type type,
+struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_format_type format_type,
struct lttng_ust_event *event_param,
struct lttng_channel *chan)
{
enabler = zmalloc(sizeof(*enabler));
if (!enabler)
return NULL;
- enabler->type = type;
+ enabler->format_type = format_type;
CDS_INIT_LIST_HEAD(&enabler->filter_bytecode_head);
CDS_INIT_LIST_HEAD(&enabler->excluder_head);
memcpy(&enabler->event_param, event_param,
return lttng_add_net_ns_to_ctx(ctx);
case LTTNG_UST_CONTEXT_PID_NS:
return lttng_add_pid_ns_to_ctx(ctx);
+ case LTTNG_UST_CONTEXT_TIME_NS:
+ return lttng_add_time_ns_to_ctx(ctx);
case LTTNG_UST_CONTEXT_USER_NS:
return lttng_add_user_ns_to_ctx(ctx);
case LTTNG_UST_CONTEXT_UTS_NS: