Rename `enum lttng_enabler_type` to `_format_type`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 13 Dec 2019 21:57:45 +0000 (16:57 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 Nov 2020 18:08:56 +0000 (13:08 -0500)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I4d1e97da03df3983cba8b65c35d42818e0a967a5

include/lttng/ust-events.h
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ust-abi.c

index 66c7390b9e24100c7e0ff84b63bdee14cbc592d6..49d864d8a9f668be6b59e5b8e440a5b5c9479a17 100644 (file)
@@ -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);
index d1beac3a6d027154e5d40acd696a0d1cfcb6cf14..527aa69ce4cc256defe582b971e5ea79ceb9f4b3 100644 (file)
@@ -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,
index c060e2d9aaae49f033cf420f0155bb7a03d5d4c8..126863d7455f20ab127006e3b880590273a01fd1 100644 (file)
@@ -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:
This page took 0.027972 seconds and 5 git commands to generate.