Add support for UST's autoincrementing enum entries
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 4 Jul 2016 21:48:42 +0000 (17:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Jul 2016 20:19:56 +0000 (16:19 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/lttng-ust-abi.h
src/bin/lttng-sessiond/lttng-ust-ctl.h
src/bin/lttng-sessiond/ust-metadata.c

index 7bec0c961f09475a27b754ef81ae03e43f8c1fe7..0487320b897f050405b1126bea10ab851bf1a327 100644 (file)
@@ -44,7 +44,7 @@
 #define LTTNG_UST_COMM_MAGIC                   0xC57C57C5
 
 /* Version for ABI between liblttng-ust, sessiond, consumerd */
-#define LTTNG_UST_ABI_MAJOR_VERSION            6
+#define LTTNG_UST_ABI_MAJOR_VERSION            7
 #define LTTNG_UST_ABI_MINOR_VERSION            1
 
 enum lttng_ust_instrumentation {
index b8cf775e382a38a72d0c64428fd9b6c95d2abd7e..c0723d095ab7002c821901ac9c1cae124a8f2b62 100644 (file)
@@ -297,7 +297,12 @@ struct ustctl_enum_value {
 struct ustctl_enum_entry {
        struct ustctl_enum_value start, end; /* start and end are inclusive */
        char string[LTTNG_UST_SYM_NAME_LEN];
-       char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+       union {
+               struct {
+                       uint8_t is_auto;
+               } LTTNG_PACKED options;
+               char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+       } u;
 } LTTNG_PACKED;
 
 #define USTCTL_UST_BASIC_TYPE_PADDING  296
index c97013f438a88df9b9d7ccf1205761731261860b..328d6ea4c414d15699c6c3aa84fdc70eede3b8e4 100644 (file)
@@ -300,38 +300,52 @@ int ust_metadata_enum_statedump(struct ust_registry_session *session,
                                goto end;
                        }
                }
-               ret = lttng_metadata_printf(session,
-                               "\" = ");
+               ret = lttng_metadata_printf(session, "\"");
                if (ret) {
                        goto end;
                }
 
-               if (entry->start.signedness) {
-                       ret = lttng_metadata_printf(session,
-                               "%lld", (long long) entry->start.value);
+               if (entry->u.options.is_auto) {
+                       ret = lttng_metadata_printf(session, ",\n");
+                       if (ret) {
+                               goto end;
+                       }
                } else {
                        ret = lttng_metadata_printf(session,
-                               "%llu", entry->start.value);
-               }
-               if (ret) {
-                       goto end;
-               }
+                                       " = ");
+                       if (ret) {
+                               goto end;
+                       }
 
-               if (entry->start.signedness == entry->end.signedness &&
-                               entry->start.value == entry->end.value) {
-                       ret = lttng_metadata_printf(session,
-                               ",\n");
-               } else {
-                       if (entry->end.signedness) {
+                       if (entry->start.signedness) {
                                ret = lttng_metadata_printf(session,
-                                       " ... %lld,\n", (long long) entry->end.value);
+                                       "%lld", (long long) entry->start.value);
                        } else {
                                ret = lttng_metadata_printf(session,
-                                       " ... %llu,\n", entry->end.value);
+                                       "%llu", entry->start.value);
+                       }
+                       if (ret) {
+                               goto end;
+                       }
+
+                       if (entry->start.signedness == entry->end.signedness &&
+                                       entry->start.value ==
+                                               entry->end.value) {
+                               ret = lttng_metadata_printf(session, ",\n");
+                       } else {
+                               if (entry->end.signedness) {
+                                       ret = lttng_metadata_printf(session,
+                                               " ... %lld,\n",
+                                               (long long) entry->end.value);
+                               } else {
+                                       ret = lttng_metadata_printf(session,
+                                               " ... %llu,\n",
+                                               entry->end.value);
+                               }
+                       }
+                       if (ret) {
+                               goto end;
                        }
-               }
-               if (ret) {
-                       goto end;
                }
        }
        nesting--;
This page took 0.028007 seconds and 4 git commands to generate.