From e450e3396b0bfe998e3bde6aef7dc3b4232f8edb Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Fri, 13 Dec 2019 16:57:45 -0500 Subject: [PATCH] Rename `enum lttng_enabler_type` to `_format_type` Currently, the `_type` field is used to express in what format the event rule was provided, either the full event name or a glob pattern. Future commit will introduce the concept event notifier enabler that will be along side regular event enabler. The use of the `_type` suffix might become confusing with this new class of enablers. So this commit rename the `_type` field to `_format_type`. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I4d1e97da03df3983cba8b65c35d42818e0a967a5 --- include/lttng/ust-events.h | 10 +++++----- liblttng-ust/lttng-events.c | 14 +++++++------- liblttng-ust/lttng-ust-abi.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 66c7390b..49d864d8 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -380,9 +380,9 @@ struct lttng_probe_desc { /* Data structures used by the tracer. */ -enum lttng_enabler_type { - LTTNG_ENABLER_STAR_GLOB, - LTTNG_ENABLER_EVENT, +enum lttng_enabler_format_type { + LTTNG_ENABLER_FORMAT_STAR_GLOB, + LTTNG_ENABLER_FORMAT_EVENT, }; /* @@ -390,7 +390,7 @@ enum lttng_enabler_type { * backward reference. */ struct lttng_enabler { - enum lttng_enabler_type type; + enum lttng_enabler_format_type format_type; /* head list of struct lttng_ust_filter_bytecode_node */ struct cds_list_head filter_bytecode_head; @@ -692,7 +692,7 @@ struct lttng_channel *lttng_channel_create(struct lttng_session *session, int lttng_channel_enable(struct lttng_channel *channel); int lttng_channel_disable(struct lttng_channel *channel); -struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_type type, +struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_format_type type, struct lttng_ust_event *event_param, struct lttng_channel *chan); int lttng_enabler_enable(struct lttng_enabler *enabler); diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index d1beac3a..527aa69c 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -631,7 +631,7 @@ int lttng_desc_match_star_glob_enabler(const struct lttng_event_desc *desc, 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; @@ -654,7 +654,7 @@ int lttng_desc_match_event_enabler(const struct lttng_event_desc *desc, 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) { @@ -673,8 +673,8 @@ static 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; @@ -702,7 +702,7 @@ int lttng_desc_match_enabler(const struct lttng_event_desc *desc, } return 1; } - case LTTNG_ENABLER_EVENT: + case LTTNG_ENABLER_FORMAT_EVENT: return lttng_desc_match_event_enabler(desc, enabler); default: return -EINVAL; @@ -1041,7 +1041,7 @@ void lttng_ust_events_exit(void) /* * 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) { @@ -1050,7 +1050,7 @@ struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_type type, 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, diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index c060e2d9..126863d7 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -797,7 +797,7 @@ static int lttng_abi_create_enabler(int channel_objd, struct lttng_ust_event *event_param, void *owner, - enum lttng_enabler_type type) + enum lttng_enabler_format_type format_type) { struct lttng_channel *channel = objd_private(channel_objd); struct lttng_enabler *enabler; @@ -813,7 +813,7 @@ int lttng_abi_create_enabler(int channel_objd, * We tolerate no failure path after event creation. It will stay * invariant for the rest of the session. */ - enabler = lttng_enabler_create(type, event_param, channel); + enabler = lttng_enabler_create(format_type, event_param, channel); if (!enabler) { ret = -ENOMEM; goto event_error; @@ -892,10 +892,10 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg, * we create the special star globbing enabler. */ return lttng_abi_create_enabler(objd, event_param, - owner, LTTNG_ENABLER_STAR_GLOB); + owner, LTTNG_ENABLER_FORMAT_STAR_GLOB); } else { return lttng_abi_create_enabler(objd, event_param, - owner, LTTNG_ENABLER_EVENT); + owner, LTTNG_ENABLER_FORMAT_EVENT); } } case LTTNG_UST_CONTEXT: -- 2.34.1