[Spice-commits] 2 commits - Makefile.am configure.ac tools/Makefile.am tools/reds_stat.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Oct 19 06:20:11 UTC 2016
Makefile.am | 2 +-
configure.ac | 1 +
tools/Makefile.am | 19 +++++++++++++++++++
tools/reds_stat.c | 11 ++++++-----
4 files changed, 27 insertions(+), 6 deletions(-)
New commits:
commit a0fcf4975ba7ec916a630cfcd3232c19d8582fcc
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Sep 26 09:05:07 2016 +0100
Add reds_stat to compiled software
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/Makefile.am b/Makefile.am
index 7eb0f28..5272d5a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
NULL =
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = spice-common server docs
+SUBDIRS = spice-common server docs tools
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = spice-server.pc
diff --git a/configure.ac b/configure.ac
index 483f18b..68aed15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -272,6 +272,7 @@ server/spice-version.h
server/tests/Makefile
docs/Makefile
docs/manual/Makefile
+tools/Makefile
])
dnl ==========================================================================
diff --git a/tools/Makefile.am b/tools/Makefile.am
new file mode 100644
index 0000000..03980c5
--- /dev/null
+++ b/tools/Makefile.am
@@ -0,0 +1,19 @@
+NULL =
+
+AM_CPPFLAGS = \
+ $(COMMON_CFLAGS) \
+ $(SPICE_PROTOCOL_CFLAGS) \
+ $(WARN_CFLAGS) \
+ $(NULL)
+
+AM_LDFLAGS = \
+ $(LIBRT) \
+ $(NULL)
+
+noinst_PROGRAMS = \
+ reds_stat \
+ $(NULL)
+
+reds_stat_SOURCES = \
+ reds_stat.c \
+ $(NULL)
commit d79e781706d5fa9bc08b44b0e7c120a85b32384d
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Sep 26 08:48:44 2016 +0100
Remove warnings from reds_stat utility
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/tools/reds_stat.c b/tools/reds_stat.c
index 9aca1ad..3e966d4 100644
--- a/tools/reds_stat.c
+++ b/tools/reds_stat.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <spice/stats.h>
#define TAB_LEN 4
@@ -33,15 +34,14 @@
static SpiceStat *reds_stat = (SpiceStat *)MAP_FAILED;
static uint64_t *values = NULL;
-void print_stat_tree(int32_t node_index, int depth)
+static void print_stat_tree(int32_t node_index, int depth)
{
SpiceStatNode *node = &reds_stat->nodes[node_index];
- int i;
if ((node->flags & SPICE_STAT_NODE_MASK_SHOW) == SPICE_STAT_NODE_MASK_SHOW) {
printf("%*s%s", depth * TAB_LEN, "", node->name);
if (node->flags & SPICE_STAT_NODE_FLAG_VALUE) {
- printf(":%*s%llu (%llu)\n", (VALUE_TABS - depth) * TAB_LEN - strlen(node->name) - 1, "",
+ printf(":%*s%"PRIu64" (%"PRIu64")\n", (int) ((VALUE_TABS - depth) * TAB_LEN - strlen(node->name) - 1), "",
node->value, node->value - values[node_index]);
values[node_index] = node->value;
} else {
@@ -60,7 +60,6 @@ int main(int argc, char **argv)
{
char *shm_name;
pid_t kvm_pid;
- uint64_t *val;
uint32_t num_of_nodes = 0;
size_t shm_size;
size_t shm_old_size;
@@ -98,7 +97,9 @@ int main(int argc, char **argv)
goto error;
}
while (1) {
- system("clear");
+ if (system("clear") != 0) {
+ printf("\n\n\n");
+ }
printf("spice statistics\n\n");
if (num_of_nodes != reds_stat->num_of_nodes) {
num_of_nodes = reds_stat->num_of_nodes;
More information about the Spice-commits
mailing list