Rename `enum lttng_enabler_type` to `_format_type`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 5 Dec 2019 19:37:57 +0000 (14:37 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 Nov 2020 17:56:09 +0000 (12:56 -0500)
This will avoid confusion between the different types of enablers
(event notifier enablers and event enablers).

- Enabler format types describe the way the event name matching is done.

- Enabler types will describe the type of enablers (event
  notifier vs event)

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic71d05159c5f244d0b1ad74f9c0ee6247fcdfbbb

include/lttng/events.h
src/lttng-abi.c
src/lttng-events.c

index 3ba8525f3f2a7da566f50cc04bfa58ef25320c10..72a12857c7cf038c7a4a65e188279f20876570b3 100644 (file)
@@ -327,9 +327,9 @@ struct lttng_event {
        int has_enablers_without_bytecode;
 };
 
-enum lttng_enabler_type {
-       LTTNG_ENABLER_STAR_GLOB,
-       LTTNG_ENABLER_NAME,
+enum lttng_enabler_format_type {
+       LTTNG_ENABLER_FORMAT_STAR_GLOB,
+       LTTNG_ENABLER_FORMAT_NAME,
 };
 
 /*
@@ -339,7 +339,7 @@ enum lttng_enabler_type {
 struct lttng_enabler {
        enum lttng_event_type evtype;   /* First field. */
 
-       enum lttng_enabler_type type;
+       enum lttng_enabler_format_type format_type;
 
        struct list_head node;  /* per-session list of enablers */
        /* head list of struct lttng_ust_filter_bytecode_node */
@@ -558,7 +558,7 @@ void lttng_unlock_sessions(void);
 
 struct list_head *lttng_get_probe_list_head(void);
 
-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_kernel_event *event_param,
                struct lttng_channel *chan);
 
index 219d20a044e284c63f1688a9a06df514b28bceb6..1ef5ae43e7416b87bc6f900756818d7171c10998 100644 (file)
@@ -1359,10 +1359,10 @@ int lttng_abi_create_event(struct file *channel_file,
                         * If the event name is a star globbing pattern,
                         * we create the special star globbing enabler.
                         */
-                       enabler = lttng_enabler_create(LTTNG_ENABLER_STAR_GLOB,
+                       enabler = lttng_enabler_create(LTTNG_ENABLER_FORMAT_STAR_GLOB,
                                event_param, channel);
                } else {
-                       enabler = lttng_enabler_create(LTTNG_ENABLER_NAME,
+                       enabler = lttng_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
                                event_param, channel);
                }
                priv = enabler;
index 5023d450b1bd77f50969776c32b8e2735a192317..05abc8172f3f1238e99668f7521fdb7a6399a62c 100644 (file)
@@ -1237,10 +1237,10 @@ int lttng_desc_match_enabler(const struct lttng_event_desc *desc,
        switch (enabler->event_param.instrumentation) {
        case LTTNG_KERNEL_TRACEPOINT:
                desc_name = desc->name;
-               switch (enabler->type) {
-               case LTTNG_ENABLER_STAR_GLOB:
+               switch (enabler->format_type) {
+               case LTTNG_ENABLER_FORMAT_STAR_GLOB:
                        return lttng_match_enabler_star_glob(desc_name, enabler_name);
-               case LTTNG_ENABLER_NAME:
+               case LTTNG_ENABLER_FORMAT_NAME:
                        return lttng_match_enabler_name(desc_name, enabler_name);
                default:
                        return -EINVAL;
@@ -1293,10 +1293,10 @@ int lttng_desc_match_enabler(const struct lttng_event_desc *desc,
                }
                switch (enabler->event_param.u.syscall.match) {
                case LTTNG_SYSCALL_MATCH_NAME:
-                       switch (enabler->type) {
-                       case LTTNG_ENABLER_STAR_GLOB:
+                       switch (enabler->format_type) {
+                       case LTTNG_ENABLER_FORMAT_STAR_GLOB:
                                return lttng_match_enabler_star_glob(desc_name, enabler_name);
-                       case LTTNG_ENABLER_NAME:
+                       case LTTNG_ENABLER_FORMAT_NAME:
                                return lttng_match_enabler_name(desc_name, enabler_name);
                        default:
                                return -EINVAL;
@@ -1499,7 +1499,7 @@ int lttng_fix_pending_events(void)
        return 0;
 }
 
-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_kernel_event *event_param,
                struct lttng_channel *chan)
 {
@@ -1508,7 +1508,7 @@ struct lttng_enabler *lttng_enabler_create(enum lttng_enabler_type type,
        enabler = kzalloc(sizeof(*enabler), GFP_KERNEL);
        if (!enabler)
                return NULL;
-       enabler->type = type;
+       enabler->format_type = format_type;
        INIT_LIST_HEAD(&enabler->filter_bytecode_head);
        memcpy(&enabler->event_param, event_param,
                sizeof(enabler->event_param));
This page took 0.030379 seconds and 4 git commands to generate.