src.ctf.lttng-live: return unsigned integers in `sessions` query object
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 16 Aug 2019 23:41:46 +0000 (19:41 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 17 Aug 2019 05:31:12 +0000 (01:31 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I1a0f505ee17f5657395d358dfcaa09fdc8e2afa1
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1960
Tested-by: jenkins <jenkins@lttng.org>
src/cli/babeltrace2.c
src/plugins/ctf/lttng-live/viewer-connection.c

index 87d812fd178ca8b36b56dea287caba4368c2d8d0..e32e1a0930f63160c3dbff47f2cea5305dd77dbc 100644 (file)
@@ -981,7 +981,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                        BT_CLI_LOGE_APPEND_CAUSE("Missing `timer-us` entry.");
                        goto error;
                }
-               timer_us = bt_value_integer_signed_get(v);
+               timer_us = bt_value_integer_unsigned_get(v);
                fprintf(out_stream, " (timer = %" PRIu64 ", ", timer_us);
                v = bt_value_map_borrow_entry_value_const(map, "stream-count");
                if (!v) {
@@ -989,7 +989,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                                "Missing `stream-count` entry.");
                        goto error;
                }
-               streams = bt_value_integer_signed_get(v);
+               streams = bt_value_integer_unsigned_get(v);
                fprintf(out_stream, "%" PRIu64 " stream(s), ", streams);
                v = bt_value_map_borrow_entry_value_const(map, "client-count");
                if (!v) {
@@ -997,7 +997,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                                "Missing `client-count` entry.");
                        goto error;
                }
-               clients = bt_value_integer_signed_get(v);
+               clients = bt_value_integer_unsigned_get(v);
                fprintf(out_stream, "%" PRIu64 " client(s) connected)\n", clients);
        }
 
index 6b206d3427077a976e5765985ed213d0c4383462..ddc250145068c69913d0fed9ad154ff5172539ad 100644 (file)
@@ -361,10 +361,10 @@ int list_update_session(bt_value *results,
                                ret = -1;
                                goto end;
                        }
-                       val = bt_value_integer_signed_get(btval);
+                       val = bt_value_integer_unsigned_get(btval);
                        /* sum */
                        val += streams;
-                       bt_value_integer_signed_set(btval, val);
+                       bt_value_integer_unsigned_set(btval, val);
 
                        btval = bt_value_map_borrow_entry_value(map, "client-count");
                        if (!btval) {
@@ -372,10 +372,10 @@ int list_update_session(bt_value *results,
                                ret = -1;
                                goto end;
                        }
-                       val = bt_value_integer_signed_get(btval);
+                       val = bt_value_integer_unsigned_get(btval);
                        /* max */
                        val = bt_max_t(int64_t, clients, val);
-                       bt_value_integer_signed_set(btval, val);
+                       bt_value_integer_unsigned_set(btval, val);
                }
 
                if (found) {
@@ -469,7 +469,7 @@ int list_append_session(bt_value *results,
        {
                uint32_t live_timer = be32toh(session->live_timer);
 
-               insert_status = bt_value_map_insert_signed_integer_entry(
+               insert_status = bt_value_map_insert_unsigned_integer_entry(
                        map, "timer-us", live_timer);
                if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
                        BT_COMP_LOGE_STR("Error inserting \"timer-us\" entry.");
@@ -485,7 +485,7 @@ int list_append_session(bt_value *results,
        {
                uint32_t streams = be32toh(session->streams);
 
-               insert_status = bt_value_map_insert_signed_integer_entry(map,
+               insert_status = bt_value_map_insert_unsigned_integer_entry(map,
                        "stream-count", streams);
                if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
                        BT_COMP_LOGE_STR("Error inserting \"stream-count\" entry.");
@@ -501,7 +501,7 @@ int list_append_session(bt_value *results,
        {
                uint32_t clients = be32toh(session->clients);
 
-               insert_status = bt_value_map_insert_signed_integer_entry(map,
+               insert_status = bt_value_map_insert_unsigned_integer_entry(map,
                        "client-count", clients);
                if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
                        BT_COMP_LOGE_STR("Error inserting \"client-count\" entry.");
This page took 0.0291 seconds and 4 git commands to generate.