Cleanup: apply `include-what-you-use` guideline for `uint*_t`
[lttng-ust.git] / liblttng-ust / ust-core.c
index 5355f5c117ad62104c34ee1fd7cfe2d94f67f810..abea7bbdffb137fdbbae86e2d1c7c4f2422372bb 100644 (file)
@@ -19,6 +19,8 @@
  */
 
 #define _LGPL_SOURCE
+#include <stdint.h>
+#include <stddef.h>
 #include <stdlib.h>
 #include <lttng/ust-events.h>
 #include <usterr-signal-safe.h>
@@ -63,21 +65,20 @@ void lttng_transport_unregister(struct lttng_transport *transport)
 /*
  * Needed by comm layer.
  */
-struct lttng_enum *lttng_ust_enum_get(struct lttng_session *session,
-               const char *enum_name)
+struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_session *session,
+               const struct lttng_enum_desc *enum_desc)
 {
        struct lttng_enum *_enum;
        struct cds_hlist_head *head;
        struct cds_hlist_node *node;
-       size_t name_len = strlen(enum_name);
+       size_t name_len = strlen(enum_desc->name);
        uint32_t hash;
 
-       hash = jhash(enum_name, name_len, 0);
+       hash = jhash(enum_desc->name, name_len, 0);
        head = &session->enums_ht.table[hash & (LTTNG_UST_ENUM_HT_SIZE - 1)];
        cds_hlist_for_each_entry(_enum, node, head, hlist) {
                assert(_enum->desc);
-               if (!strncmp(_enum->desc->name, enum_name,
-                               LTTNG_UST_SYM_NAME_LEN - 1))
+               if (_enum->desc == enum_desc)
                        return _enum;
        }
        return NULL;
This page took 0.023207 seconds and 4 git commands to generate.