profile-testbed.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Index: Makefile.am
  2. ===================================================================
  3. --- Makefile.am (revision 29343)
  4. +++ Makefile.am (working copy)
  5. @@ -59,7 +59,7 @@
  6. $(top_builddir)/src/testing/libgnunettesting.la \
  7. $(top_builddir)/src/testbed/libgnunettestbed.la \
  8. $(top_builddir)/src/arm/libgnunetarm.la \
  9. - $(LTLIBINTL) $(Z_LIBS)
  10. + $(LTLIBINTL) $(Z_LIBS) -lprofiler
  11. gnunet_service_testbed_DEPENDENCIES = \
  12. libgnunettestbed.la
  13. Index: gnunet-service-testbed.c
  14. ===================================================================
  15. --- gnunet-service-testbed.c (revision 29341)
  16. +++ gnunet-service-testbed.c (working copy)
  17. @@ -26,6 +26,7 @@
  18. #include "gnunet-service-testbed.h"
  19. #include "gnunet-service-testbed_barriers.h"
  20. +#include <gperftools/profiler.h>
  21. /***********/
  22. /* Globals */
  23. @@ -956,9 +957,14 @@
  24. main (int argc, char *const *argv)
  25. {
  26. //sleep (15); /* Debugging */
  27. - return (GNUNET_OK ==
  28. - GNUNET_SERVICE_run (argc, argv, "testbed", GNUNET_SERVICE_OPTION_NONE,
  29. - &testbed_run, NULL)) ? 0 : 1;
  30. + int ret;
  31. +
  32. + ProfilerStart (NULL);
  33. + ret = GNUNET_SERVICE_run (argc, argv, "testbed", GNUNET_SERVICE_OPTION_NONE,
  34. + &testbed_run, NULL);
  35. + ProfilerStop ();
  36. + return (GNUNET_OK == ret) ? 0 : 1;
  37. +
  38. }
  39. /* end of gnunet-service-testbed.c */