From a91cb83e0e5536c14328ddef0ba2b571063dbbdd Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 16 Aug 2019 19:41:46 -0400 Subject: [PATCH] src.ctf.lttng-live: return unsigned integers in `sessions` query object Signed-off-by: Philippe Proulx Change-Id: I1a0f505ee17f5657395d358dfcaa09fdc8e2afa1 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1960 Tested-by: jenkins --- src/cli/babeltrace2.c | 6 +++--- src/plugins/ctf/lttng-live/viewer-connection.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index 87d812fd..e32e1a09 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -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); } diff --git a/src/plugins/ctf/lttng-live/viewer-connection.c b/src/plugins/ctf/lttng-live/viewer-connection.c index 6b206d34..ddc25014 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.c +++ b/src/plugins/ctf/lttng-live/viewer-connection.c @@ -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."); -- 2.34.1