[gnome-builder] ide-list-counters: print the number of discovered counters



commit 4960f63c5789d67d642b65af8c2aa9a5ae73c724
Author: Christian Hergert <christian hergert me>
Date:   Wed May 13 11:06:34 2015 -0700

    ide-list-counters: print the number of discovered counters

 tools/ide-list-counters.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tools/ide-list-counters.c b/tools/ide-list-counters.c
index 61c4c82..b104661 100644
--- a/tools/ide-list-counters.c
+++ b/tools/ide-list-counters.c
@@ -26,6 +26,10 @@ static void
 foreach_cb (EggCounter *counter,
             gpointer    user_data)
 {
+  guint *n_counters = user_data;
+
+  (*n_counters)++;
+
   g_print ("%-20s : %-32s : %20"G_GINT64_FORMAT" : %-s\n",
            counter->category,
            counter->name,
@@ -62,6 +66,7 @@ main (gint   argc,
       gchar *argv[])
 {
   EggCounterArena *arena;
+  guint n_counters = 0;
   gint pid;
 
   if (argc != 2)
@@ -91,11 +96,12 @@ main (gint   argc,
            "-------------------------------- : "
            "-------------------- : "
            "------------------------------------------------------------------------\n");
-  egg_counter_arena_foreach (arena, foreach_cb, NULL);
+  egg_counter_arena_foreach (arena, foreach_cb, &n_counters);
   g_print ("-------------------- : "
            "-------------------------------- : "
            "-------------------- : "
            "------------------------------------------------------------------------\n");
+  g_print ("Discovered %u counters\n", n_counters);
 
   return EXIT_SUCCESS;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]