AC_SUBST(MONKEYPREFIX)
+AC_MSG_CHECKING([whether to compile in benchmarks (currently for http and crypto)])
+AC_ARG_ENABLE([benchmark],
+ [AS_HELP_STRING([--enable-benchmark], [enable benchmarking])],
+ [enable_benchmark=${enableval}],
+ [enable_benchmark=no])
+AC_MSG_RESULT($enable_benchmark)
+AS_IF([test "x$enable_benchmark" = "xyes"],
+ [AC_DEFINE_UNQUOTED(ENABLE_BENCHMARK,1,[Benchmarks are enabled])])
+AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmark" = "xyes"])
+
+
# should expensive tests be run?
AC_MSG_CHECKING(whether to run expensive tests)
AC_ARG_ENABLE([expensivetests],
src/transport/transport-testing-main.c
src/transport/transport-testing-send.c
src/util/bandwidth.c
+src/util/benchmark.c
src/util/bio.c
src/util/client.c
src/util/common_allocation.c
XLIB = -lgcov
endif
+if ENABLE_BENCHMARK
+ BENCHMARK = benchmark.c
+ PTHREAD = -lpthread
+endif
+
w32cat_SOURCES = w32cat.c
gnunet_helper_w32_console_SOURCES = \
libgnunetutil_la_SOURCES = \
bandwidth.c \
+ $(BENCHMARK) \
bio.c \
client.c \
common_allocation.c \
$(LIBGCRYPT_LIBS) \
$(LTLIBICONV) \
$(LTLIBINTL) \
- -lltdl -lidn $(Z_LIBS) -lunistring $(XLIB)
+ -lltdl -lidn $(Z_LIBS) -lunistring $(XLIB) $(PTHREAD)
libgnunetutil_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) \
#include <gcrypt.h>
#include "gnunet_crypto_lib.h"
#include "gnunet_strings_lib.h"
+#include "benchmark.h"
#define EXTRA_CHECKS 0
int rc;
gcry_mpi_t rs[2];
+#if ENABLE_BENCHMARK
+ struct BenchmarkData *bd = get_benchmark_data ();
+ bd->eddsa_sign_count++;
+ printf("crypto eddsa sign\n");
+#endif
+
priv_sexp = decode_private_eddsa_key (priv);
data = data_to_eddsa_value (purpose);
if (0 != (rc = gcry_pk_sign (&sig_sexp, data, priv_sexp)))